1

From EC2 Linux, using AWS SES email template I am trying to send an email with background image. However, image and the script build in json located in the same path. But still I am not able to see background image in an email.

Below is the HTML in json which I am using.

"HtmlPart": "body{background-image: url(\"home/ec2-user/Test/Sample-Backgrd.jpg\");background-color: #cccccc;\r\n}</style>"

Can anybody help me if there is any issue in above script?

svw1105
  • 21
  • 3

1 Answers1

0

You should specify the public path(https://... to the image or encode the image(for instance to base64 and provide it in the html)

Hubert Bratek
  • 894
  • 10
  • 30
  • for https, do I need to install httpd service in Linux? – svw1105 Jun 16 '20 at 13:28
  • It would be much easier to convert this image to the base64 and send it using it. – Hubert Bratek Jun 16 '20 at 16:46
  • Thanks for the suggestion. I tried your recommendation but still not getting background image in an email. – svw1105 Jun 16 '20 at 17:10
  • { "Template": { "TemplateName": "myTemplate22", "SubjectPart": "Latest JOB Details", "HtmlPart": " – svw1105 Jun 16 '20 at 17:13
  • @gihansalith - can you please help me here? – svw1105 Jun 16 '20 at 19:22