How to send HTML format email with emebbed images using Outlook 2010 and
python
just as shown below, currently I have already implemented sending HTML
format email using Outlook 2010 and python
def send_mail_via_com(self):
o = win32com.client.Dispatch("Outlook.Application")
Msg = o.CreateItem(0)
Msg.To = self.myEmailAddress
Msg.BCC = self.myEmailAddress
Msg.Subject = 'This is Subject'
Msg.HTMLBody = htmlEmailContent
Msg.Send()
Going forward, I want to show some embed images in the HTML format email,
I've check the the HTML source, it looks like following:
I tried to attached the image files(using the same name referenced in
above html codes as attachment) but it will just be attachment and won't
be shown in the text body as embed image. Can somebody here tell me how to
achieve it? thanks in advance!
attachment1 = "G:\\image001.png"
Msg.Attachments.Add(attachment1)
No comments:
Post a Comment