title: How to send e-mails using NLog?
body: <p>I'm using NLog, and I'm pretty new at logging. I created the log files but somehow I have a problem whit sending e-mails. I followed all instructions but couldn't make it.</p>
  
  <p>Mail settings in configuration tags in web.config: </p>
  
  <pre><code>&lt;system.net&gt;
  &lt;mailSettings&gt;
    &lt;smtp deliveryMethod="SpecifiedPickupDirectory" from="some@some.org"&gt;
      &lt;network host="localhost"/&gt;
      &lt;specifiedPickupDirectory pickupDirectoryLocation="d:\tmp\email"/&gt;
    &lt;/smtp&gt;
  
  &lt;/mailSettings&gt;
  &lt;/system.net&gt;
  </code></pre>
  
  <p>And this is the target inside the nlog.config:  </p>
  
  <pre><code>    &lt;target name="Mail" xsi:type="Mail" html="true" subject="Error Received" 
   body="${message}"
   to="some1@some.com"
   from="some@gmail.com"
   encoding="UTF-8"
   smtpUserName="some@some.com"
   enableSsl="false"
   smtpPassword="password"
   smtpAuthentication="Basic"
   smtpServer="smtp.some.com"
   smtpPort="25" /&gt;
  </code></pre>
  
  <p></p>
  
  <p>The rule I used:</p>
  
  <pre><code>       &lt;logger name="*" minlevel="Error" writeTo="Mail" /&gt;
  </code></pre>
  
  <p>And I called the logger like this:</p>
  
  <pre><code>     Logger logger = LogManager.GetCurrentClassLogger();
       try{ //something }
       catch(Exception ex){  logger.Error(ex);  }
  </code></pre>
  
  <p>And also I'm pretty confused about the places of the settings and configurations. Thank you.</p>