Skip to content
This repository has been archived by the owner on Aug 4, 2024. It is now read-only.

Email settings

Ryan Newington edited this page Jul 1, 2018 · 2 revisions

SMTP 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>

Email templates

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

Managing your web.config file

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.