If I attach an image to an email, how can I place it in the HTML content? I tried just using the filename as the image source but that doesn't seem to work.
Embedding attached images in HTML emails
emailmime
Related Question
- Python – Sending HTML email using Python
- Python – Sending Multipart html emails which contain embedded images
- Excel – Setting mime type for excel document
- Javascript – Detect when browser receives file download
- Android – How to send emails from the Android application
- Html – embedding image in html email
- PHP mail function doesn’t complete sending of e-mail
Best Solution
Be more specific on how you build the HTML mail message.
The result will be a multipart-MIME message with a text/html part (if you really do it right with an alternate part of type text/plain) and several images, which are then referenced from within the HTML.
See RFC 1813 and RFC 2378 for more information about content-id in mixed MIME and related data (referred by CID in the HTML source).