Email sent using Message Gateway has lot of empty spaces in Outlook/Gmail applications | Community
Skip to main content
Level 4
April 15, 2024
Solved

Email sent using Message Gateway has lot of empty spaces in Outlook/Gmail applications

  • April 15, 2024
  • 1 reply
  • 1493 views

Hi all,


When trying to send out emails via AEM using message Gateway service (Emails configured via CQ Mail Service)

 

 

when inspecting on web mail applications there are lot of nested <div> which have no occurrence in the original html.

any suggestions on why this would be happening?

 

@arunpatidar@estebanbustamante@raja_reddy

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Rohan_Garg

not sure, we are using the below code snip -

public void sendEmail(String contentEmail, String userName, String subjectLine, List<String> emailRecipients) throws EmailException, AddressException {
Email email = new HtmlEmail();
email.setCharset(Constants.CHARACTER_ENCODING_UTF_8);
email.setFrom(Constants.FROM_EMAIL);

    Email email = new HtmlEmail();

Can you try changing the Email class to HtmlEmail class?

org.apache.commons.mail package has the below classes - 

HtmlEmail has start string has <html><body><pre>

 

Thanks,

Rohan Garg

1 reply

sravs
Community Advisor
Community Advisor
April 15, 2024

Hi @aem_noob , Are you using any customized email template or OOTB email template. If you are using customized template please check the template structure.

 

Please refer for more details on email templates,

https://medium.com/@toimrank/aem-email-custom-template-style-and-attachment-d4c0a196ec98

https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/where-can-find-email-templates-in-aem/m-p/304110

aem_noobAuthor
Level 4
April 15, 2024

we're using custom email templates.

We checked the template structure but there is nothing in the markup for the page when seen on view as published.

It is only when viewing the mail we see empty spaces.

 

sravs
Community Advisor
Community Advisor
April 15, 2024

@aem_noob can you please check whether your template is following all the required  configurations mentioned in https://experienceleague.adobe.com/en/docs/experience-manager-65/content/sites/administering/operations/notification#email-templates-for-workflow-notification

 

if it possible can you please share the template?