KaushaL.NET

Accessing Web.Config File SMTP Mail Settings Programmatically

Posted by: Kaushal on: September 5, 2008

I needed to read my SMTP email settings defined under system.net 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)

<system.net>
<mailSettings>
<smtp deliveryMethod=”Network” from=”testuser@domail.com”>
<network defaultCredentials=”true” host=”localhost” port=”25″ userName=”kaushal” password=”testPassword”/>
</smtp>
</mailSettings>
</system.net>

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

Read More…

Leave a Reply

You must be logged in to post a comment.

Victims

  • 38,971 Hits

Calendar

September 2008
M T W T F S S
« Aug   Jan »
1234567
891011121314
15161718192021
22232425262728
2930  

Archives

KaushaL Parik (Microsoft MVP – ASP.NET)