My new blog present here.

Featured Post

Insights into Sitecore Search: A Definitive Introduction

A key component of digital experience management is effective information retrieval. A simplified approach is required for websites, applications, and platforms containing a lot of material so that consumers can easily get the data they require. This need is met by Sitecore, a well-known name in the field of digital experience platforms (DXPs), which provides powerful and comprehensive search functionality. We will travel into the realm of Sitecore Search in this article, learning about its capabilities, architecture , and the enormous value it offers both developers and end users. Introduction to Sitecore Search    A headless content discovery platform powered by AI , Sitecore Search enables you to build predictive and custom search experiences across various content sources. To extract and ...

Sitecore Error Troubleshooting: Troubleshooting Sitecore Email Experience(EXM) Email Campaign Message Preview and Test email not being send

Sitecore Error Troubleshooting: Troubleshooting Sitecore Email Experience(EXM) Email Campaign Message Preview and Test email not being send

The Sitecore Email Experience Manager (EXM) guides you through the process of creating and sending your email campaigns.
To use Sitecore Email Experience(EXM) Email Campaign, after setting up the SMTP, I tried to create the Email Campaign but getting following errors:


1. Not able to see the Message Preview in the Message tab and getting the error in the Front End/Screen as The selected page could not be displayed:

To troubleshoot the issue, I checked the EXM log file at web root for Sitecore site: C:\inetpub\wwwroot\sc902.1.com\App_Data\logs\ Exm.log.XXXXX.XXX.txt and found below mentioned error:

Nested Exception
Exception: System.Net.Sockets.SocketException
Message: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 172.23.96.44:80
Source: System
at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception)
16824 10:41:55 ERROR Exception: Sitecore.EmailCampaign.Model.Web.Exceptions.NonCriticalException
Message: Failed to download string content, URL: http://192.20.96.44/?sc_itemid=%7B899A10F7-89D3-48A6-8D7D-63A350B7E7DB%7D&sc_lang=en&sc_device=%7BFE5D7FDF-89C0-4D99-9AA3-B5FBD009C9F3%7D&ec_database=master&ec_id=14532115AEB24E4481A2108DB1BCD512&ec_message_id=53A6EF153B84427ABC08003458A76091, Use IIS Credentials: True, UserAgent: ECM Dispatch
Source: Sitecore.EmailCampaign
at Sitecore.Modules.EmailCampaign.Core.WebContent.DownloadString(String url, Boolean useIisCredentials, String userAgent)
at Sitecore.Modules.EmailCampaign.Messages.WebPageMail.GetMessageBody(Boolean preview)
at Sitecore.EmailCampaign.Cm.MessageInfo.FillContentEditorInfo()

I was getting exception as Sitecore.EmailCampaign.Model.Web.Exceptions.NonCriticalException.

2. Not able to receive the test email even the SMTP settings was working fine and its showing the success message on screen.

To cross check, I verified the EXM log file at web root: C:\inetpub\wwwroot\sc902.1.com\App_Data\logs\ Exm.log.XXXXX.XXX.txt and found below mentioned error:

Exception: System.Net.WebException
Message: The remote server returned an error: (502) Bad Gateway.
Source: System
at System.Net.HttpWebRequest.GetResponse()
at Sitecore.Modules.EmailCampaign.Core.WebContent.DoDownloadString(String url, Boolean useIisCredentials, String userAgent)
at Sitecore.Modules.EmailCampaign.Core.WebContent.DownloadString(String url, Boolean useIisCredentials, String userAgent)
4748 16:13:21 INFO Registered email: test@gmail.com
4748 16:13:21 INFO Test Dispatch Message (TestEmail): Started
Message Id: {6D199D8F-96C3-40AD-8A10-D723788102E0}
Message Path: /sitecore/content/Email/Messages/2018/11/16T080459/TestEmail
Included Recipient Lists:
Excluded Recipient Lists:
4748 16:13:21 WARN Failed to create counter 'CPUAvgPerformance'. Sitecore does not have the necessary permissions for reading/creating counters. Details: System.UnauthorizedAccessException: Access to the registry key 'Global' is denied.
at Microsoft.Win32.RegistryKey.Win32Error(Int32 errorCode, String str)
at Microsoft.Win32.RegistryKey.InternalGetValue(String name, Object defaultValue, Boolean doNotExpand, Boolean checkSecurity)
at Microsoft.Win32.RegistryKey.GetValue(String name)
at System.Diagnostics.PerformanceMonitor.GetData(String item)
at System.Diagnostics.PerformanceCounterLib.GetPerformanceData(String item)
at System.Diagnostics.PerformanceCounterLib.get_CategoryTable()
at System.Diagnostics.PerformanceCounterLib.CounterExists(String category, String counter, Boolean& categoryExists)
at System.Diagnostics.PerformanceCounterLib.CounterExists(String machine, String category, String counter)
at System.Diagnostics.PerformanceCounter.InitializeImpl()
at System.Diagnostics.PerformanceCounter..ctor(String categoryName, String counterName, String instanceName, Boolean readOnly)
at System.Diagnostics.PerformanceCounter..ctor(String categoryName, String counterName, String instanceName)
at Sitecore.Modules.EmailCampaign.Core.Dispatch.CpuAvgPerformance..ctor()
at Sitecore.Modules.EmailCampaign.Core.Dispatch.TimeSummary..ctor(ILogger logger)
27624 16:13:24 ERROR Exception: System.Net.WebException
Message: The remote server returned an error: (502) Bad Gateway.

In the above error details, 502 bad gateway error for System.Net.HttpWebRequest.GetResponse  and also 'CPUAvgPerformance' error was coming with download email template using  DownloadString method:http://192.20.96.44/?sc_itemid=%7B899A10F7-89D3-48A6-8D7D-63A350B7E7DB%7D&sc_lang=en&sc_device=%7BFE5D7FDF-89C0-4D99-9AA3-B5FBD009C9F3%7D&ec_database=master&ec_id=14532115AEB24E4481A2108DB1BCD512&ec_message_id=53A6EF153B84427ABC08003458A76091, due to this email email was not getting delivered.

For any preview, Sitecore EXM module will use the site url and after that it will append item id with database which showcase the email preview to user. But here instead of site host name, it was taking the IP address like http://192.20.96.44, due to this email template preview was not showing on the screen.

I verified and found that I earlier added the binding using the IP address 192.20.96.44 in IIS: due to this the IP being used instead of HOST name and message preview was not working



After removing the IP address, message preview started working:


It means that, if you add binding with the IP address, then instead of taking default localhost binding 127.0.0.1 sc902.1.com, it will take binding which added in the IIS.

Comments

Popular posts from this blog

Sitecore GraphQL Queries

Sitecore Experience Edge GraphQL Queries

Sitecore Experience Manager Cloud (XM Cloud) Building blocks