ASP.Net Email setting within a web.config file

For user who used .NET to send out email and want to use their mail server with us to send out the email, the following can be added to your web.config file.

<system.net>
<mailSettings>
<smtp from="username@domain.com">
<network host="mail.domain.com" />
</smtp>
</mailSettings>
</system.net>

Please change the SMTP field to a valid email address for your domain. The host field will need to be changed to the mail server for you account.

Note: You will not need to specify the SMTP port, username and/or password in the settings as the webserver will have access to send the email through the mail server.

Add Feedback