-
Notifications
You must be signed in to change notification settings - Fork 28
Email settings
The web.config
file in the root of the application directory controls the mail server settings
The following example sends email from laps@lithnet.io
using the server smtp.lithnet.io with STARTTLS enabled.
<system.net>
<mailSettings>
<smtp deliveryMethod="Network" from="laps@lithnet.io">
<network host="smtp.lithnet.io" port="25" defaultCredentials="false" enableSsl="true" />
</smtp>
</mailSettings>
</system.net>
If authentication is required, you can provide credentials explicitly
<system.net>
<mailSettings>
<smtp deliveryMethod="Network" from="laps@lithnet.io">
<network host="smtp.lithnet.io" port="25" userName="user" password="password" enableSsl="true" />
</smtp>
</mailSettings>
</system.net>
See the topic on Customizing log and email messages for information on how to change the content of the email messages sent by the application
Always take a backup of your web.config file before and after making any changes. A malformed web.config file will stop your web site from loading. If this happens, check the event log for the specific details of the problem or roll back the file to a known-good version.
You should also keep a backup copy of your working web.config file. It is easy to accidentally overwrite it when deploying a new version of the web application.