Tuesday, 9 September 2014

How to Get SMTP Settings from DNN

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"];

About the Author

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

0 comments :

Post a Comment