Python -Ausblick

import win32com.client
outlook = win32com.client.Dispatch("Outlook.Application")
# 创建一个邮件对象
mail = outlook.CreateItem(0)
# 对邮件的各个属性进行赋值
mail.To = "收件人邮箱"
mail.Subject = "邮件主题"
mail.Body = "邮件正文"
mail.Attachments.Add("附件绝对路径")
# 添加多个附件
# mail.Attachments.Add("附件1绝对路径")
# mail.Attachments.Add("附件2绝对路径")...
# 邮件发送
mail.Send()
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Bewildered Beaver