【发布时间】:2019-12-22 15:54:35
【问题描述】:
outlook = win32com.client as win32
mail = outlook.CreateItem(0)
for j in range(list)
file = "C:desktop\\image{}.png".format(j)
attachment = mail.Attachments.Add(file)
index = "ID{}".format(j)
attachment.PropertyAccessor.SetProperty("http://schemas.microsoft.com/mapi/proptag/0x3712001F", index)
mail.HTMLBody = "<html><body> image <img src = ""cid:ID%s""></body></html>" % (j)
mail.Send()
目的是将所有图像(0、1、2、...由“列表”定义的最大数量)嵌入到电子邮件中。但现在卡在 for 循环中。请问有没有什么方法可以达到这个目的?谢谢!
【问题讨论】:
标签: python html-email