Accessing Web.Config File SMTP Mail Settings Programmatically

I needed to read my SMTP email settings defined under section in my web.config file. In order to use eNewsLetter and other SiteAdmin CMS modules that sending email notifications; you can setup your web.config to defind SMTP services settings.

Below is one example of SMTP email setting defined in web.config file:
(Under <configuration> Section)

<smtp deliveryMethod=”Network” from=””>
<network defaultCredentials=”true” host=”localhost” port=”25″ userName=”kaushal” password=”testPassword”/>

To Access, this SMTP Mail Setting Programatically, you need to import below namespaces:

Read More…


Get every new post delivered to your Inbox.