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.
Option 01:
- attach the file "mySignaturePictue.jpg" as attachment to the mail
- reference this attachment from the body (insert it) whith code like:
<img src="cid:mySignaturePicture.png">
Option 02:
- convert your image to a base64 string: http://www.motobit.com/util/base64-decoder-encoder.asp
- insert it to the mailtext/html-body with code like
<img alt="My Image" src="data:image/jpeg;base64,AWWhcalkjsd/beginning/RXhp/of+/long/base64cod/ZgAATU0/+BlaBlubbZ5u8/61a+Xand/much/more..." />
- Downside: this is blocked by most clients and will increase the mail size, see: https://www.campaignmonitor.com/blog/email-marketing/2013/02/embedded-images-in-html-email/ and https://www.paperstreet.com/blog/email-marketing-embeded-images-cid-what-a-mess/