I have a function which send images to the email
The requirements is, i have only two images the first one i need to send as a attachments and another one in the body .
Using alternative in the MIMEmultipart it sending the both images as a documents and i have tried using two multipart that is also not helping. let me know how to approach the issue and also let me know whether it is possible or not
Any idea would be appreciated
According to HTML-Email with inline attachments and non-inline attachments, the MIME way is to build an inner mime/related message containing both the HTML text and the inline image(s), and an outer one containing the mime/related message and the other attachment(s).
Your code could become
After @triplee's comment, I gave a try to the
EmailMessageAPI. It comes with far more black magic, so things are much simpler if less explicit: