Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No multipart/related Content-Type for inline images #74

Open
gregality opened this issue Dec 9, 2015 · 1 comment
Open

No multipart/related Content-Type for inline images #74

gregality opened this issue Dec 9, 2015 · 1 comment

Comments

@gregality
Copy link

Hi, I'm currently trying to embed an image in an email using the CID approach. The latest code on the master branch has support for setting the Content-ID, but it doesn't also set the MIME part to "related" (it sets it to "mixed").

In testing, some email clients, notably Gmail and Thunderbird, won't display the images in-line unless the MIME type is set to "related", while other clients (Outlook, Yahoo) will display the images in-line.

Is there a reason why the MIME type is hard-coded to 'mixed'?

See Issue #57 where the MIME spec's are referenced. Also, these stackoverflow posts are helpful:

http://stackoverflow.com/questions/3902455/smtp-multipart-alternative-vs-multipart-mixed

http://stackoverflow.com/questions/19497672/multipart-messages-including-multiple-attachments-attachment-and-inline-wi

Thanks!

@oscarmlage
Copy link

I've hardcoded a multipart/related string here instead multipart/mixed in order to test it and it seems it works (at least in Thunderbird and Gmail). OTOH it screw up things a bit in Apple Mail (iOS/iPad): if you're sending some real attachments in the email, not only the CID images, Apple Mail detects that there are attachments but you're not able to download them.

I guess the attachments needs to be sent with the proper Content-Type:

  • CID Images: multipart/related
  • Real attachments (pdf, doc or whatever): multipart/mixed

My 2 cents.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants