MTA Configuration In Sitecore

Friday, June 03, 2016 @ 02:55

By: Scott Gillis, Lead Consultant – Email Experience Manager (EXM), formerly Email Campaign Manager (ECM), is a key toolset in completing the engagement cycle with site visitors. A properly managed email campaign will allow you to further engage your site visitors after they have left visiting the site. By leveraging Sitecore to manage this, you a) cut out requirements to purchase and maintain another toolset, b) can leverage site visit data to better target email messages, and c) all data is collected into a single source for well-rounded reporting.

A Little EXM Background

EXM does not come pre-installed in a Sitecore installation. It must be downloaded and installed after the initial site setup. When looking to install, you need to make sure that you install the correct version for your Sitecore instance. A list of all available versions can be found at https://dev.sitecore.net/en/Downloads/Email_Experience_Manager. One thing to note for the advanced editor looking to explore EXM, is that downloads of the products are only available to those who have been awarded a Sitecore Developer Certificate, so talk with your Sitecore Partner or Sales Rep for more information.

I will point out that, in the past year and a half, Sitecore has gotten much better at matching EXM (and WFFM for that matter) versions to that of the core Experience Manager (CMS). Here is a helpful table to assist you pinpoint which version you want.

Sitecore
Experience
Manager
EXM URL
8.1 rev. 151207
(Update-1)
3.2 rev. 160127
(Update-1)
https://dev.sitecore.net/Downloads/Email_Experience_Manager/Email_Experience_Manager_32/Email_Experience_Manager_32_Update1.aspx
8.1 rev. 151003
(Initial Release)
3.2 rev. 151020
(Initial Release)
https://dev.sitecore.net/Downloads/Email_Experience_Manager/Email_Experience_Manager_32/Email_Experience_Manager_32_Initial_Release.aspx
8.0 rev. 151127
(Update-6)
3.1 rev. 151213
(Update-2)
https://dev.sitecore.net/Downloads/Email_Experience_Manager/Email_Experience_Manager_31/Email_Experience_Manager_31_Update_2.aspx
8.0 rev. 150812
(Update-5)
3.1 rev. 150811
(Update-1)
https://dev.sitecore.net/Downloads/Email_Experience_Manager/Email_Experience_Manager_31/Email_Experience_Manager_31_Update1.aspx
8.0 rev. 150621
(Update-4)
3.1 rev. 150811
(Update-1)
https://dev.sitecore.net/Downloads/Email_Experience_Manager/Email_Experience_Manager_31/Email_Experience_Manager_31_Update1.aspx
8.0 rev. 150427
(Update-3)
3.1 rev. 150703
(Initial Release)
https://dev.sitecore.net/Downloads/Email_Experience_Manager/Email_Experience_Manager_31/Email_Experience_Manager_31_Initial_Release.aspx
8.0 rev. 150427
(Update-3)
3.0 rev. 150429
(Update-3)
https://dev.sitecore.net/Downloads/Email_Experience_Manager/Email_Experience_Manager_30/Email_Experience_Manager_30_Update3.aspx
8.0 rev. 150223
(Update-2)
3.0 rev. 150223
(Update-2)
https://dev.sitecore.net/Downloads/Email_Experience_Manager/Email_Experience_Manager_30/Email_Experience_Manager_30_Update2.aspx
8.0 rev. 150121
(Update-1)
3.0 rev. 150126
(Update-1)
https://dev.sitecore.net/Downloads/Email_Experience_Manager/Email_Experience_Manager_30/Email_Experience_Manager_30_Update1.aspx
8.0 rev. 141212
(Initial Release)
3.0 rev. 141217
(Initial Release)
https://dev.sitecore.net/Downloads/Email_Experience_Manager/Email_Experience_Manager_30/Email_Experience_Manager_30_Initial_release.aspx

How do Emails Send

EXM provides an interface to create emails, schedule sends, build recipient lists, and track read and bounced message data on your emails. It does NOT perform the actual technical send of the email! EXM must call to an actual email sending service, also called a Mail Transfer Agent or MTA.

A default install of EXM is configured for you to purchase sending capabilities directly from Sitecore via the Sitecore App Center. This may be perfect once everything has been elevated into production, but will not be the best solution for a QA or development environment. If you are a super high volume sender, Sitecore's offering may not be cost effective for your organization.

Thankfully, as with most things in Sitecore, there is usually another option that involves a little extra configuration work, and in this scenario, that would be the 'UseLocalMTA' flag.

Setup for a non-Sitecore MTA Usage

  • To be able to send via other Mail Transfer Agents, your Sitecore license must include a specific flag. This is flag is not always included by default, so reach out to your Sitecore sales representative or Sitecore Partner to for more information.
    • If you have configured Local MTA, but have not updated your license file, you may receive an error message similar to the following:
      "The <a href='/sitecore/shell/Applications/SitecoreApps/Loader.aspx' target='_blank'>Sitecore App Center</a> password is not set."
      MTA Configuration in Sitecore - Image One
    Your license does not allow you to use a specific MTA to send messages. Contact your Administrator or Sitecore representative.
    MTA Configuration in Sitecore - Image Two
  • Configure EXM to talk with your chosen MTA provider. The settings are all contained in App_Config \ Include \ EmailExperience \ Sitecore.EmailExperience.ContentManagement.config, which you can happily edit directly...which would be a big Sitecore NO-NO! Instead, use the following patch file that is to be placed into your 'z.loadlast' directory in App_Config \ Include. ["The z.what the hell directory" you ask, take a look at my post How Sitecore Config Files Load.]

Using Amazon SES as your Mail Transfer Agent

If you are looking for an excellent production alternative to Sitecore's services, Amazon SES is most likely on your radar. Getting configured for sending is fairly quick, especially when using a patch config file to load your settings. From a development and QA perspective, if you are able to stay under the messaging limits, Amazon SES is an excellent alternative to a standalone SMTP server.

  • Create a new Amazon Web Services (AWS) account or login to your existing account
  • From the list of available services pick SES
    MTA Configuration in Sitecore - Image Three
  • Once in SES, we need to verify one or more email address that messages will be sent from. If you are running as a free test account, the email addresses for recipients of the messages must also be verified. Click "Email Addresses" from the left-side menu
    MTA Configuration in Sitecore - Image Four
  • Create SMTP Credentials, by clicking on "SMTP Settings" in the left-side menu
  • Click the large blue button for Create My SMTP Credentials in the center of the page
    MTA Configuration in Sitecore - Image Five
  • Amazon provides a nice wizard that walks you through getting your SMTP Credentials. Follow these steps and be sure to download/copy the username and password that was generated for you
    MTA Configuration in Sitecore - Image Six
  • Updated the patch config based on the following notes:
    Setting Value
    UseLocalMTA True
    Sleep 500 (if you are running under the test account of AWS, there is a need to delay how quick the relay is)
    SMTP.Server Taken from the Server Name field in step 5
    SMTP.Port 25 (feel free to change to 465 or 587, as supported by Amazon)
    SMTP.UserName Username value from step 6, this is what you should have downloaded. Do NOT use your AWS account name, as it will not authenticate
    SMTP.Password Password value from step 6, this is what you should have downloaded. Do NOT use your AWS account password, as it will not authenticate
    SMTP.AuthMethod LOGIN (this must be in all CAPS)
    SMTP.StartTLS True (as defined in the under SMTP Settings in SES)
  • Login to Sitecore and send a test email. Make sure the sending address has been verified or you will receive errors

The above gives the basics for email setup using another mail transfer agent. For some of the more complicated setup or to learn more, here are some references to Sitecore's documentation.

As always, feel free to tweet me questions or comments @thecodeattic or on Sitecore Slack Community as @gillissm.

 

 

Scott Gillis, Lead Consultant at Paragon and 2017 Sitecore MVP, has been working with Sitecore for several years. He has a deep passion for helping clients leverage their content and data into powerful new capabilities in Sitecore and has produced successful outcomes as the technical lead on numerous, complex implementations. Recently, Scott has been focusing on helping these clients take advantage of the wealth of data collected by Sitecore Experience Analytics.