Tuesday, April 4, 2017

Setup custom smtp for Sitecore EXM 3.0 and 3.4

For setup custom SMTP for EXM 3.0:  You just need to add one patch config for SMTP setting which I previously described on my blog. You can found here.

Just move this patch file under include folder of Sitecore.

When you try for sending test email via EXM it show message "
The connection to the Sitecore App Center could not be established.". 
For removing this because you are usingIf you are using custom mail server instead of Sitecore App Center then you need to set the “UseLocalMTA” as “true” in Sitecore.EmailCampaign.config with SMTP details.
Now you are able to send an email via EXM 3.0.

For setup custom SMTP for EXM 3.4: For setup EXM 3.4 with Sitecore 8.2 you just need to update following config


At first, I follow the instruction which is shown when we install EXM that are shown below:


***Important! Copy and save this information***
==========================================================
    BEFORE YOU CLICK NEXT:
    - Add two empty connection strings with the names "exm.master" and "exm.web" to /App_Config/ConnectionStrings.config e.g. <add name="exm.master" connectionString="" /> and <add name="exm.web" connectionString="" />.
    - Add two connection strings with the names "EXM.CryptographicKey" and "EXM.AuthenticationKey" to \App_Config\ConnectionStrings.config. The keys should be represented in hexadecimal format by 64 characters. For more information please see the installation guide.

    BEFORE YOU CLOSE THE WIZARD:
    - Click the checkbox ‘Restart the Sitecore client’.

    AFTER YOU CLOSE THE WIZARD:
    After the package is installed, follow these steps to complete the EXM installation:
    1. Attach the Sitecore.Exm and Sitecore.Exm_Web databases. The files can be located in the Data folder.
    2. Update the connection strings "exm.master" and "exm.web" in /App_Config/ConnectionStrings.config, e.g. <add name="exm.master" connectionString="user id=user;password=password;Data Source=(server);Database=Sitecore_EXM" /> and <add name="exm.web" connectionString="user id=user;password=password;Data Source=(server);Database=Sitecore_EXM.Web" />.
    3. Enable the Sitecore MTA or the Custom SMTP provider files in the /App_Config/Include/EmailExperience folder by removing the .disabled extension from the files.
    4. In the /App_Config/Include/Sitecore.Analytics.Tracking.config file, ensure the value of the Analytics.ClusterName setting is set to your instance host name.
    5. Publish your site using smart publish. 
    6. In the App Center, configure the Email Delivery service if you are using the Sitecore MTA provider.
    7. In the App Center, sign up for the Email Preview and Spam Detect services. [optional]

I just do some update in few config files that are listed below.
1. Sitecore.EDS.Provider.CustomSmtp.config


In this config I do following changes:


<smtpSettings type="Sitecore.EDS.Core.Net.Smtp.SmtpSettings, Sitecore.EDS.Core" singleInstance="true">
                    <server>smtp.gmail.com</server>
                    <port>587</port>
                    <userName>xxxxxxxx@gmail.com</userName>
                    <password>xxxxxxx</password>
                    <authenticationMethod>Login</authenticationMethod>
                    <startTls>true</startTls>
                    <proxySettings ref="exm/eds/proxySettings" />
</smtpSettings>

      2.  Sitecore.EDS.Provider.CustomSmtp.Sync.config



<pop3Settings>
          <pop3Setting type="Sitecore.EDS.Core.Net.Pop3.Pop3Settings, Sitecore.EDS.Core" singleInstance="true">
            <server>pop.gmail.com</server>
            <port>995</port>
            <userName>xxxxxxxxx@gmail.com</userName>
            <password>xxxxxxxxx</password>
            <useSsl>true</useSsl>
            <startTls>true</startTls>
            <proxySettings ref="exm/eds/proxySettings"/>
          </pop3Setting>
 </pop3Settings>

        3. Sitecore.Analytics.Tracking.config


<s<setting name="Analytics.ClusterName" value="{Hostname}" />

I I also path a custom config as well that include following entry.


<?xml version="1.0" encoding="utf-8" ?>
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
  <sitecore>
    <settings>
      <setting name="MailServer" value="smtp.gmail.com"/>
      <!--  MAIL SERVER USER
        If the SMTP server requires login, enter the user name in this setting
  -->
      <setting name="MailServerUserName" value="xxxxx@gmail.com"/>
      <!--  MAIL SERVER PASSWORD
        If the SMTP server requires login, enter the password in this setting
  -->
      <setting name="MailServerPassword" value="xxxxxx"/>
      <!--  MAIL SERVER PORT
        If the SMTP server requires a custom port number, enter the value in this setting.
        The default value is: 25
  -->
      <setting name="MailServerPort" value="587"/>
   
    </settings>
  </sitecore>
</configuration>

After these changes I am able to send email via EXM 3.4 for Sitecore 8.2.

Note: Instead of setting up the custom email account for testing I strongly recommend to use papercut for this. this is use for setup custom SMTP setup for the local system. You can found here.

I also found one blog by Brijesh Patel more useful as well. You can found that blog here.

I hope you enjoy this Sitecore blog. Stay tuned for more Sitecore related articles.

Till that happy Sitecoring :)

Please leave your comments or share this article if it’s useful for you.

No comments:

Post a Comment