SMTP settings outside of web.config

This is the place to report bugs and get support. When posting in this forum, please always provide as much detail as possible.

Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum, do not report it as a bug.

This is the place to report bugs and get support

When posting in this forum, please try to provide as many relevant details as possible. Particularly the following:

  • What operating system were you running when the bug appeared?
  • What database platform is your site using?
  • What version of mojoPortal are you running?
  • What version of .NET do you use?
  • What steps are necessary to reproduce the issue? Compare expected results vs actual results.
Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum.
This thread is closed to new posts. You must sign in to post in the forums.
9/21/2010 7:49:25 PM
Gravatar
Total Posts 10

SMTP settings outside of web.config

In your documentation here 

http://www.mojoportal.com/emailconfiguration.aspx

you say that smtp settings must be in web.config. I found an article indicating that it might be possible to have system.net mailSettings outside web.config. After a little testing, I found that it works, so this may help ease updates by making the system.net smtp settings external to web.config.

<system.net>
  <mailSettings>
<smtp configSource="MailSettings.config">
</smtp>
</mailSettings>
</system.net>

 

Then the MailSettings.config looks something like this:

 <smtp from="myemail@mydomain.com">
<network host="myhost" port="myport" userName="user@mydomain.com" password="mypassword" />
</smtp>

 

9/22/2010 7:15:20 AM
Gravatar
Total Posts 18439

Re: SMTP settings outside of web.config

Hi Steve,

The problem is that doing this will not reduce maintenance of the Web.config during upgrades. If we specify an external file, then we must include that file and it would overwrite a file of the same name during upgrades so to use a custom file you would still have to edit the Web.config to point to the custom file and this is the same amount of effort as just maintaining the smtp settings directly in Web.config. In fact having more files to worry about during upgrades I think would cause more confusion and more support issues.

It would be nice if it worked like the <appSettings where you could point to a different file that will override if the file exists but keep default settings right in Web.config, but it doesn't work that way.

Best,

Joe

You must sign in to post in the forums. This thread is closed to new posts.