|
要调用Outlook来发送,可参考这段代码,将相关 标题 邮箱换成你自己的,做个循环
Dim myolApp As New Outlook.Application '创建Outlook应用程序对象
Dim myNamespace As Outlook.NameSpace
Dim myFolder As Outlook.MAPIFolder
Dim myattachments As Outlook.Attachments
Dim i As Integer
Dim olEmail As OutlookEmail
Set myNamespace = myolApp.GetNamespace("MAPI") '获取MAPI命名空间
Set myFolder = myNamespace.GetDefaultFolder(FolderType) '获取默认文件夹为收件箱
For i = 1 To myFolder.Items.Count
With myFolder.Items(i)
If EmailEntryID = .EntryID Then
olEmail.EntryID = .EntryID
olEmail.UnRead = .UnRead '未读标志
olEmail.SenderName = .SenderName '发件人姓名
olEmail.SenderEmailAddress = .SenderEmailAddress '发件人电子邮件地址
olEmail.CC = .CC '抄送
olEmail.BCC = .BCC '秘密抄送
olEmail.Subject = .Subject '主题
olEmail.LastModificationTime = .LastModificationTime '发送日期和时间
olEmail.Body = .Body '正文
olEmail.HTMLBody = .HTMLBody '正文
olEmail.Size = .Size '大小
olEmail.Importance = .Importance '重要性
olEmail.IsAttachments = IIf(.Attachments.Count > 0, True, False)
End If
End With
Next
GetOutlookEmail = olEmail
Set myolApp = Nothing
Set myNamespace = Nothing
Set myFolder = Nothing |
|