电子邮件:基础知识深入
当你自动运行Outlook时,最常见的操作就是发送电子邮件。因此,精通一些高级电子邮件技术是很值得的。下面简单的代码可以制作一个包含附件的邮件,然后发送它,不过它需要Microsoft Outlook 9.0 对象库(Object Library)的支持。
Dim oOutlookApp As New Outlook.Application
Dim oItemMail As Outlook.MailItem
Set oItemMail = oOutlookApp.CreateItem(olMailItem)
With oItemMail
.Subject = "Message Generated By _Automating Outlook from Visual Basic"
.Body = "Outlook is Great!"
.Attachments.Add ("D:\OutlookObjectsSummary.doc")
.Attachments.Add ("D:\CodeSamples.doc")
.Importance = olImportanceHigh
.Recipients.Add ("Angela.Jones@aol.com")
.Recipients.Add ("KevinT@aol.com")
.Sensitivity = olPersonal
.Send
End With
延伸阅读
文章来源于领测软件测试网 https://www.ltesting.net/