Reputation: 1
I embedded several images into my HTML email template using the syntax below.
<figure id="keyboardimg">
<img src="/img/keyboard.jpg" alt="Keyboard image" title="Keyboard image">
</figure>
I used both of the following "hypertext references" to link the images to the HTML email template but the images are not showing. Any advice on how to address this issue will be really appreciated.
Upvotes: 0
Views: 3013
Reputation: 1
The best way to include images in the email is by uploading it to any CDN and then using the image's public URL as the image source in your Email template.
The best alternative for this thing is to upload your images to an Amazon S3 bucket and then use its HTTPS URL.
But, you can do the same by hosting your email template over GitHub pages for free and then using the image's URL stored on the Github server.
This way you can also show a preview of your email templates to people online.
Upvotes: 0
Reputation: 107
You were using "relative URLs." They assume that the image is found on the same server as the document. When the document is served by email, the image is not on the email server, and the relative URL doesn't work. When sending an email, you need to reference all resources (including images) using absolute URLs.
<figure id="keyboardimg">
<img src="https://i.ibb.co/nfr6M2s/Modern.jpg" alt="Keyboard image" title="Keyboard image">
</figure>
Upvotes: 1