There are Web.config and Web.debug.config and Web.release.config files in my visual studio solution window.
I want to set different email configurations for release and debug.
So I set Web.debug.config file
<system.net>
<mailSettings>
<smtp deliveryMethod="SpecifiedPickupDirectory">
<network host="localhost" port="587" defaultCredentials="true"/>
<specifiedPickupDirectory pickupDirectoryLocation="C:\Temp\Mail\Debug"/>
</smtp>
</mailSettings>
</system.net>
And I set my Web.release.config
<system.net>
<mailSettings>
<smtp deliveryMethod="SpecifiedPickupDirectory">
<network host="localhost" port="587" defaultCredentials="true"/>
<specifiedPickupDirectory pickupDirectoryLocation="C:\Temp\Mail\Release"/>
</smtp>
</mailSettings>
</system.net>
When I run the applciaitons, my settings does not load to SmtpClient object.
Why does not take settings from Web.debug.config

This only works for when you publish a project, not in the IDE. Read more here:
https://msdn.microsoft.com/en-us/library/dd465318(v=vs.100).aspx
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With