Python embedded Thunderbird

I can't get thunderbird to show any inline images that I email via python. It shows small empty boxes on the image and the image under the body (not a typical application).

letters are true in Outlook and Yahoo.

Am I missing a headline?

self.msg = MIMEMultipart( ) fp = open( path2img , 'rb') msgImage = MIMEImage(fp.read()) fp.close() msgImage.add_header('Content-ID', '<imagename>') msgImage.add_header('Content-Disposition' , 'inline' , filename='image.png') msgImage.add_header('Content-Type' , 'image/png') self.msg.attach(msgImage) 

My source image in the body of the letter:

 <img src="cid:imagename"> 

I looked everywhere and I can’t understand why! please, help.

(my Python may be small, but good enough for Outlook / Yahoo)

early

+4
source share
2 answers

You need to specify the value "filename", not the Content-ID. For instance:

 <img src="cid:image.png"/> 

See this question for more information: Display an attached image in an HTML message

+1
source

I had the same problem. Just change the MIMEMultipart constructor to:

 self.msg = MIMEMultipart('related') 

and it will work.

0
source

All Articles