NLog Mail target issue

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

NLog Mail target issue

Elindalyne
I've been trying to get the mail target working for quite a bit of time.
I'm currently using .net Framework 4.0 and have been using v2.0.0.0 of the NLog dlls.

Basically I can get other targets to work, however when I try to use the mail target, it just appears to do nothing.


Here is a super basic config I've been using for testing purposes:


<?xml version="1.0"?>
<configuration>
  <configSections>
    <section name="nlog" type="NLog.Config.ConfigSectionHandler, NLog" />
  </configSections>
  <nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         autoReload="true" internalLogLevel="Info" internalLogFile="C:\ProgramData\nlogTest\logs\nlog-log.log" throwExceptions="true">
    <targets async="true">
      <target name="file" xsi:type="File" fileName="C:\ProgramData\nlogTest\logs\app.log" />
      <target name="email" xsi:type="Mail"
              subject="Error"
              to="fakeemail@fakeemail.com"
              from="fake@gmail.com"
              body="Test12345"
              smtpServer="smtp.gmail.com"
              smtpUserName="fake@gmail.com"
              smtpPassword="fake12345"
              smtpAuthentication="Basic"
              smtpPort="587"
              enableSsl="true"/>
    </targets>
    <rules>
      <logger name="*" minlevel="Info" writeTo="file" />
      <logger name="*" minlevel="Info" writeTo="email" />
    </rules>
  </nlog>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>


At this point I'm rather stumped and would be willing to even post the test application in its entirety if it will help get this resolved.
Loading...