```
 <nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.nlog-project.org/schemas/NLog.xsd NLog.xsd" autoReload="true" throwExceptions="false" internalLogLevel="Off" internalLogFile="c:\temp\nlog-internal.log">
<extensions>
  <add assembly="NLog.MailKit"/>
</extensions>

 <targets async="true">
<target name="errorLogger" xsi:type="Mail"
        smtpServer="mail.sample.com"
        smtpPort="3500"
        from="no-reply@mdg.com"
        to="example@demo.com"
        subject="test subject" />
</targets>
<rules>
   <logger name="EmailLogger" level="Warn" writeTo="errorLogger" />
  <logger name="EmailLogger" level="Error" writeTo="errorLogger" />
</rules>
</nlog>

```

C# code

```
private static Logger SendEmailLogger = LogManager.GetLogger("EmailLogger");
 if (exception != null)
                {
                    SendEmailLogger.Warn("Sending email from NLog");
                    SendEmailLogger.Error(exception, "Sending email from NLog");
                }

```

I think this is enough to send an email. I created custom errors too like dividebyzero and file not found errors. but still I am not getting any emails. Please can anyone suggest me, What I am missing.

I have already installed Nlog.mailkit from Nuget package. 
Internal logging Trace
[![enter image description here](https://i.stack.imgur.com/sZvWl.png)](https://i.stack.imgur.com/sZvWl.png)

Fusion++1.1 Logs
[![enter image description here](https://i.stack.imgur.com/45w2M.png)](https://i.stack.imgur.com/45w2M.png)

[![enter image description here](https://i.stack.imgur.com/3nu89.png)](https://i.stack.imgur.com/3nu89.png)

[![enter image description here](https://i.stack.imgur.com/npmNH.png)](https://i.stack.imgur.com/npmNH.png)