Python用Outlook发送邮件
s = win32com.client.Dispatch("Mapi.Session")o = win32com.client.Dispatch("Outlook.Application")
s.Logon("Outlook2003")
Msg = o.CreateItem(0)
Msg.To = "recipient@domain.com"
Msg.CC = "more email addresses here"
Msg.BCC = "more email addresses here"
Msg.Subject = "The subject of you mail"
Msg.Body = "The main body text of you mail"
attachment1 = "Path to attachment no. 1"
attachment2 = "Path to attachment no. 2"
Msg.Attachments.Add(attachment1)
Msg.Attachments.Add(attachment2)
Msg.Send()
页:
[1]