Embedding an Image in a html template Email

Hi guys,

I know that this discution has already been opened. But i Have tried a lot of ways to put an image to my html template to send an email.

Like:

  • put this, <p><img alt="Embedded Image" src="data:image/png;base64,###base64String###"/></p> , converted the image to base64 and give that as an input

  • this, <p><img src="C:/Users/appianadm/Desktop/Teste/companylogo.png" alt="companylogo" border="0"></p>, on server machine
  • this, <p><img src="C:\Users\appianadm\Desktop\Teste\companylogo.png" alt="companylogo" border="0"></p>, on server machine

 

  • <p><img src="image.ibb.co/.../companylogo.png" alt="companylogo" border="0"></p> i Uploaded the image to this website and worked but it's an external website and for the client i am working is not an option

The Result is always this:

Any suggestion?

Thanks

  Discussion posts and replies are publicly visible

  • 0
    Certified Lead Developer
    Hi if this image is static/fixed then in such case, you can convert this image to base64 format (using any online website) and put the generated base64 code in html template as mention below:

    <img src="data:image/png;base64,--your 64--"/>

    This should work. I know in this way the image will be hardcoded, but I believe it's a signature image hence its size won't be that big and this doesn't need to be dynamic, and this will make sure that the image always renders whenever this html template page loads/executes.

    Hope this will help.
  • 0
    Certified Senior Developer
    in reply to aloks0189

    My requirement is bit same , I am trying to map the img to email template dynamically from send email smart service as a paramter.

    But i am not getting image displayed in Email.

    <html><head><meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <style>
    </style>
    </head>
    <body bgcolor="lightblue">
    <div style="" $email_style;""="">
    Hi ###RecipientName###,
    <br>
    <br>
    <div dir="" ltr""="" align="" left""="">

    Your Loan Forgiveness Request : ###ForgId### is ###Action### <br><br>
    <br><br>
    You can view this request details in the dashboard here <a href="">xxxxxxxxxxxxxxxxxxxxxxxx">Forgiveness ID-###ForgId###</a> .
    <br><br>
    Thank you, <br>
    ###Sender###<p>
    <img src=\"###image###\" width="85" height="85"><br>
    </p><p><i>This is a system generated email. Please do not reply to this mail.</i></p>
    </div>
    </div>
    </body></html>

    Please confirm is this correct