Attach inline image in mail body quality
To attach an inline image in the mail body, you can use the cid
(Content ID) attribute in the HTML code of the email. Here's an example:
HTML code:
<img src="cid:image1" alt="Inline Image">
Note: Replace image1
with a unique identifier for the image.
How it works:
- When you send the email, the email client (e.g., Gmail, Outlook) will attach the image file to the email.
- The
cid
attribute in the HTML code references the attached image file. - The email client will display the image inline, within the email body.
Example email body:
<html>
<body>
<img src="cid:image1" alt="Inline Image">
</body>
</html>
Example email attachment:
image1.jpg
(the image file)
Tips:
- Make sure to use a unique identifier for the image (e.g.,
image1
,image2
, etc.) to avoid conflicts with other images. - Use a descriptive
alt
attribute to provide a text description of the image for accessibility purposes. - Some email clients may not support inline images or may display them as attachments instead. Test your email in different clients to ensure compatibility.