tags:

views:

24

answers:

1

There are many questions like this on SO, but the problem is every one of them suggests using some kind of 3rd party library. That isn't an option for me since we use an in-house queueing system, where the email gets put into our database until it's sent.

How can I embed images into emails without using 3rd party software?

A: 

Usually, if you attach an image to the email using the following MIME headers, it will be available to text/html as an image:

Content-Type: image/jpeg
Attachment-Disposition: inline; filename=MYIMAGE.JPG

And then in the message body:

Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: 7bit

<html>

    <!-- HTML tags -->
    <img src="MYIMAGE.JPG" />
    <!-- more HTML tags -->

</html>
amphetamachine