I am trying to clean up our web.config file such that per-deployment specific stuff is not kept in the main config. I have managed with the connections strings and some of the mailSettings
, but I need the from
attribute as well as the configSource
, but this doesn't seem to be allowed.
Currently I have this:
web.config:
<system.net>
<mailSettings >
<smtp configSource="email.config" from="[email protected]" />
</mailSettings>
<defaultProxy>
<proxy bypassonlocal="True" usesystemdefault="False" />
</defaultProxy>
</system.net>
email.config
<network host="myhost" password="" userName="" />
Ideally I would have the set the configSource
on either mailSettings
or system.net
, but this isn't supported.
Is there a better way to do this?