|
楼主 |
发表于 2015-5-21 15:35
|
显示全部楼层
我自己先分享一个发一个收件人的程序
Sub sendemail()
On Error Resume Next
Dim rowCount, endRowNo
Dim objOutlook As New Outlook.Application
Dim objMail As MailItem
endRowNo = Cells(1, 1).CurrentRegion.Rows.Count
Set objOutlook = New Outlook.Applic+6ation
For rowCount = 2 To endRowNo
Set objMail = objOutlook.CreateItem(olMailItem)
With objMail
.To = Cells(rowCount, 1).Value '收件人地址
.Subject = Cells(rowCount, 2).Value ' 邮件主题
.Body = Cells(rowCount, 3).Value '邮件内容
.Attachments.Add Cells(rowCount, 4).Value ' 附件保存地址 c://users.ctl
.Send
End With
Set objMail = Nothing
Next
Set objOutlook = Nothing
End Sub |
|