Why is my order receipt email not being sent?


There are a couple things that could prevent this (and other automated emails) from being sent.

Check the MailServer configuration.

These are the "MailServer.x" settings found in the web.config. Usually, this is the culprit - these must be set appropriately for your environment (hint: use a config patch). There will also be a SMTP error message in the Sitecore log file indicating the same.

Check your HostName setting.

If you're using a wildcard (*) or pipe-delimited (|) value for the "hostName" attribute of your site definition, this can cause issues with the rendering of the Rich Mail Templates. You'll notice the following error in the Sitecore log:

Exception: System.Net.WebException
Message: The remote server returned an error: (404) Not Found.
Source: System
at System.Net.WebClient.DownloadDataInternal(Uri address, WebRequest& request)
at System.Net.WebClient.DownloadData(Uri address)
at Sitecore.Web.WebUtil.ExecuteWebPage(String url, NameValueCollection headers)
at ActiveCommerce.Mails.Mail.SendMail(String templateNameOrId, Object parameters, String queryString)

The solution is to add the "targetHostName" attribute to your site definition, and use a single, resolvable host value. e.g.

<site name="mysite" hostName="*mysite.com" targetHostName="mysite.com" ... />

Check your spam folder.

Depending on mail server and from address, these emails may be caught by spam filter.

Have more questions? Submit a request