写一个批量发送邮件的VBA代码
时间: 2023-03-06 17:41:40 浏览: 253
VBA 批量发邮件
5星 · 资源好评率100%
下面是一个简单的VBA代码,可以用来批量发送邮件:Sub Send_Batch_Email()
Dim OutApp As Object
Dim OutMail As Object
Dim strbody As StringSet OutApp = CreateObject("Outlook.Application")For Each cell In Range("A1:A10")strbody = "这是一封测试邮件"Set OutMail = OutApp.CreateItem(0)With OutMail
.to = cell.Value
.Subject = "测试邮件"
.Body = strbody
.Send
End WithNext cellEnd Sub
阅读全文