Tuesday 9 September 2014

DNN: Get SMTP Settings from DotNetNuke

In your module, if you need to access to the SMTP settings specified in the HOST settings of the DNN portal, you can use the following function to retrieve it and use it in your code.

You can pass the following parameters in the function to retrieved the required setting value

- SMTPAuthentication
- SMTPEnableSSL
- SMTPPassword
- SMTPServer
- SMTPUsername

var hostSettings = DotNetNuke.Entities.Host.Host.GetHostSettingsDictionary();
string SMTPServer = hostSettings["SMTPServer"];
string SMTPAuthentication = hostSettings["SMTPAuthentication"];


/Adnan


This post is from my old blog posted on May 2012, that unfortunately no longer exist.

About the Author

Adnan Zameer, Lead Developer at Optimizley UK, is a certified Microsoft professional, specializing in web app architecture. His expertise includes Optimizley CMS and Azure, showcasing proficiency in crafting robust and efficient solutions.

0 comments :

Post a Comment