SMTP Mail client settings in app.config file C#
Posted
by Caveatrob
on Stack Overflow
See other posts from Stack Overflow
or by Caveatrob
Published on 2009-12-13T20:14:33Z
Indexed on
2010/04/01
2:53 UTC
Read the original article
Hit count: 577
I've put mail settings in app.config and can successfully pull them into a mailSettingsSectionGroup object. However, I'm not sure how to send a message using these settings.
This is what I have so far:
System.Configuration.Configuration config =
ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
MailSettingsSectionGroup mailSettings =
config.GetSectionGroup("system.net/mailSettings") as
System.Net.Configuration.MailSettingsSectionGroup;
What do I need to do next to use the mailSettings object?
© Stack Overflow or respective owner