Learning Curve…

Get Smtp “From email id” from Web.config

Posted on: February 16, 2012

Namespace:-

using System.Web.Configuration;
using System.Net.Configuration;

Code:-

System.Configuration.Configuration config = System.Web.Configuration.WebConfigurationManager.OpenWebConiguration

(HttpContext.Current.Request.ApplicationPath);
System.Net.Configuration.MailSettingsSectionGroup settings = (System.Net.Configuration.MailSettingsSectionGroup)

config.GetSectionGroup(“system.net/mailSettings”);
string strfromMailID = settings.Smtp.From;

Happy Coding!!!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Author

Learning days (Calendar)

February 2012
M T W T F S S
« Jan   Mar »
 12345
6789101112
13141516171819
20212223242526
272829  

Knowledge Bank (Archives)

I am on Twitter

Blog Stats

  • 520,167 hits

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 43 other followers

%d bloggers like this: