Logging to Email not working

905 views
Skip to first unread message

Mark Redman

unread,
Oct 13, 2014, 10:01:06 AM10/13/14
to nlog-...@googlegroups.com
I have followed the instructions to log to a gmail address:

https://github.com/NLog/NLog/wiki/Examples

I am using all settings within the nlog target, with useSystemNetMailSettings="false"

<target name="gmail" xsi:type="Mail"
            smtpServer="smtp.gmail.com" smtpPort="587" smtpAuthentication="Basic" enableSsl="true" useSystemNetMailSettings="false"
            smtpUserName="nor...@xxx.com" smtpPassword="xxx"
            from="nor...@xxx.com" to="y...@xxx.com" subject="Fatal Exception Error"
            layout="${longdate:format=yyyy-MM-dd HH:mm:ss} ${level:uppercase=true:padding=5} ${message} ${exception:format=Message,StackTrace}"
       />

The configuration is in the app.config in a windows applications.

I get the following within the internal log, although there are no emails getting sent via that account:

2014-10-13 14:40:19.3488 Debug Sending mail to y...@xxx.com using smtp.gmail.com:587 (ssl=True)

[actual email replaced with y...@xxx.xom etc]

This gmail account is being used by other .net applications without a problem.

Any ideas?

Mark Redman

unread,
Oct 14, 2014, 4:50:20 AM10/14/14
to nlog-...@googlegroups.com
Its turn out, it worked after rebooting?  hmmpft

Kim Christensen

unread,
Oct 15, 2014, 11:50:41 AM10/15/14
to nlog-...@googlegroups.com

Glad to know it worked out, although it sounds weird that it worked after a reboot

Reply all
Reply to author
Forward
0 new messages