Search code examples
emailoutlookhtml-emailmjml

Short preview of emails in Outlook shows the image src and not the alt text


I have a problem when I genereate email via MJML. The email looks great, but there is a problem in Outlook where it shows the source url of the first image in the mail instead of texts or the alt-text in the short description of the email. I'm expecting it might have something to do with that we use CDN to hosts our images, but I have no clue. See the image below:

enter image description here

Does anyone know what I can do to solve this issue?


Solution

  • Not sure why its not showing your alt text, it should work that way, in any case you can always add your preview text to the html directly after the body tag and hide it with css like this:

    <body>
        <div style="display:none;font-size:1px;color:#ffffff;line-height:1px;max-height:0px;max-width:0px;opacity:0;overflow:hidden;margin-right:100%;">
            Your Preview Text Here 
       </div>