G
Guest
I'm trying to configure email parameters in a web.config:
<configSections>
<sectionGroup name="contactForm">
<section name="email"
type="System.Configuration.NameValueSectionHandler,...
</sectionGroup>
</configSections>
<contactForm>
<email>
<add key="toaddress" value="(e-mail address removed)" />
<add key="subjectprefix" value="RideMatchEntry: " />
<add key="smtphost" value="mail.myhost.net" />
<add key="RideFindEmail" value="(e-mail address removed)"></add>
</email>
</contactForm>
When I use this code I find that variable cs is null:
ConfigurationSection cs = (ConfigurationSection)
WebConfigurationManager.GetSection("email");
Also, how do I add more than one address, can I add multiple "fromaddress"
keys or do they have to be unique? Thoroughly clueless, thanks for any
insight.
<configSections>
<sectionGroup name="contactForm">
<section name="email"
type="System.Configuration.NameValueSectionHandler,...
</sectionGroup>
</configSections>
<contactForm>
<email>
<add key="toaddress" value="(e-mail address removed)" />
<add key="subjectprefix" value="RideMatchEntry: " />
<add key="smtphost" value="mail.myhost.net" />
<add key="RideFindEmail" value="(e-mail address removed)"></add>
</email>
</contactForm>
When I use this code I find that variable cs is null:
ConfigurationSection cs = (ConfigurationSection)
WebConfigurationManager.GetSection("email");
Also, how do I add more than one address, can I add multiple "fromaddress"
keys or do they have to be unique? Thoroughly clueless, thanks for any
insight.