Home / Hosting Article & Tutorial / DotNetNuke Hosting Tips – How To Configure SMTP Logging in DotNetNuke

DotNetNuke Hosting Tips – How To Configure SMTP Logging in DotNetNuke

Sometimes it is very hard to troubleshoot SMTP issues that occur with your DotNetNuke application. Sure, you can view the SMTP log of your mail server, but that may be either misconfigured, or not even accessible at all (this is especially true in a shared hosting environment).

Luckily, there is a very simple way to enable logging for all network traffic DotNetNuke is generating, which includes SMTP traffic.

This starts with realizing that the DotNetNuke email implementation is using System.Net.Mail. Apart from the documentation on MSDN about the System.Net.Mail namespace.

On that site, we can find a very easy way to configure logging for the mail system. In fact, the way it is explained there, it will actually set up logging for all network requests done by the application. That can be very useful when troubleshooting.

ahp banner dotnetnuke-01

The set up is very simple:

name=”MyTraceFile”
type=”System.Diagnostics.TextWriterTraceListener”
initializeData=”Portals/_Default/Logs/System.Net.trace.log.resources” />

Jus put this configuration inside the node of web.config, and everything will start working. The log file will be created in /Portals/_default/Logs, and will also be accessible through Host > Host Settings > Logs.

This is a sample of what is logged when sending a test email from HostSettings:

This is a very powerful option to really troubleshoot communication between DotNetNuke and the configured SMTP server. A fair warning though: if you keep this trace active, it will generate 1 potentially very large file. If you want to keep this type of logging in your application, it is probably a good idea to make sure the log file is a rolling type. The standard TextWriterTraceListener cannot do thatFind Article, but it is not very hard to create your own listener that can.

Thanks for reading have fun troubleshooting!


ASPHostPortal LogoASPHostPortal.com offers best, cheap and reliable DotNetNuke 8.01 hosting with great features, fast and secure servers. Creating an interesting website isn’t easy, and neither is picking a good Web hosting service. Fortunately, ASPHostPortal (starting at $5 per month) stands out from the very crowded pack with a number of consumer- and business-friendly Web hosting plans that let you create multiple domains on a single server, quickly set up, and enjoy unlimited mailboxes, databases, and monthly data transfers. Why we choose ASPHostPortal for the best, cheap and reliable DotNetNuke 8.01 hosting? because ASPHostPortal.com is the leading provider of Windows and ASP.NET hosting.

ASPHostPortal proudly working to help grow the backbone of the Internet, the millions of individuals, families, micro-businesses, small business, and fledgling online businesses. ASPHostPortal has ability to support the latest Microsoft and ASP.NET technology, such as: WebMatrix, WebDeploy, Visual Studio 2015, .NET 5/ASP.NET 4.5.2, ASP.NET MVC 6.0/5.2, Silverlight 6 and Visual Studio Lightswitch, ASPHostPortal guarantees the highest quality product, top security, and unshakeable reliability, carefully chose high-quality servers, networking, and infrastructure equipment to ensure the utmost reliability. Make a smart choice and get the right Windows hosting for your DotNetNuke 8.0.1 !