Umbraco SMTP Settings
Umbraco SMTP Settings
Basics – How to specify SMTP settings in Umbraco CMS
In order to send email from an Umbraco website, valid settings for a mail server need to be entered.
Valid mail settings imply a working mail server (SMTP)) and a working account on the server, with valid credentials.
Sadly, there are so many things that can go wrong with just the above statement that it would take an entire blog post to cover the common issues. So for now I am going to assume that your mail server and mail account are working properly. (Test this is you have any problems using some kind email client.)
The settings for the mail server are found in the web.config file that is located in the file root of an Umbraco installation. The default setting looks like this:
<network host="127.0.0.1" userName="username" password="password" />
These are quick to change as long as you know your settings. Once you have changed these settings: your mail account email, your server IP address (or its domain name) and the user and password, you can go ahead and test by sending a mail. This is usually done from a contact form on the website.
Umbraco will post normally a success message on the webpage or if you’re out of luck a red error message. Sometimes this message will help to locate the error. Otherwise you can look at the Umbraco error logs, which can have a detailed explanation if you are in luck. You can find the logs files in the folder \Your_Web_Root\App_Data\Logs.
You will need this hidden option when your mail server requires a port to be specified. Also mail sending from cloud based VM’s (Virtual Machines) is often constrained by the cloud provider to prevent web spam being sent from their systems. Google Cloud Platform and Microsoft Azure have specific ports (2525 is one of them).
After a long trouble shooting session I found this setting, which can be added to the mailSettings above.
The port can often be set as part of the mail server IP address; like this:
Which works well in most systems but not in Umbraco.
Moving the port number (2525 in this case) to its own port=2525 parameter fixed my problem, which was a relief after much frustration.
My working settings looked something like this:
<network host="smtp.sendgrid.com" userName="XX" port="2525" password="ZZ" />