Its great that emailjs supports inline images:
..but I'm seeing some strange behaviour: The inline images appear twice in my mail reader (Os X Mail app) Once inline and then again as an attachment.
Tried a different reader (Google Mail) but there the image doesn't appear inline and just shows up as an attachment.
I'm wondering if this is because the attached inline image should be inside the boundary for the HTML content of the message?
A bit of juggling around with the boundaries shows that another level of boundary nesting with Content-Type: multipart/related needs to be introduced to get inline images to display properly. The nested level contains the encoded html and the image.
something like this:
Content-Type: multipart/mixed; boundary="masterboundary"
Content-Type: multipart/alternative; boundary="partboundary"
Plain text here
Content-Type: multipart/related; boundary="subpartboundary"
content-type: text/html; charset=utf-8
content-disposition: inline; filename=renamed.png
thanks @bigal488 for looking into this.
i'll push a fix through in the next week or so.
@bigal488 i have pushed a branch called 'fix-inline-images'
basically, i added support for 'multipart/related'. can you please test it to see if this fixes this issue for you on the mail clients you are testing on?
you can see in test/test.js how to attach related attachments...
..in fact really nice!! It works perfectly and I think having an array of related attachments inside the message.attach object is a great idea.
Many thanks for getting this resolved so quickly.