EXCEL VBA与OUTLOOK实现批量一对一发邮件
用途:电子邮件群发工资条、系统上线账号分发、按店铺分发报表文件、批量发送面试邀请邮件、批量发送面试者的录取通知书等等
Sub sendemail()
On Error Resume Next
Dim i, hangshu, buchang, To_Addr$, Cc_Addr$, Bcc_Addr$, SubjectText$, HTMLBodytxt$, AttachedObject1$, AttachedObject2$
Dim objOutlook As Object
Dim objMail As MailItem
Set objOutlook = CreateObject("Outlook.Application")
hangshu = 2 '[A65536].End(xlUp).Row
buchang = 1
For i = 2 To hangshu Step buchang
'——————————————————————————————————————————————————
'——————————————————————————————————————————————————
'设置收件人地址,多个地址使用","或";"间隔。
To_Addr = "e-mail地址"
'设置抄送人地址,多个地址使用","或";"间隔。
Cc_Addr = "e-mail地址"
Bcc_Addr = ""
'设置邮件主题
SubjectText = "邮件主题"
'设置邮件附件
AttachedObject1 = Th