应用工具引用:Microsoft Outlook 16.0 Object Library ‘根据outlook版本选择
或 Set Mail = CreateObject("Outlook.Application")
Sub SendEmail() Dim Mail As Outlook.Application Set Mail = New Outlook.Application Dim objMail As Outlook.MailItem Set objMail = Mail.CreateItem(olMailItem) With objMail .Subject = "My Test Mail" '主题 .To = "xx@xx.com" '收件人 .CC = "xx@xx.com" '抄送 .BCC = "xx@xx.com" '密送 .BodyFormat = olFormatHTML .HTMLBody = "<h2>My First Mail</h2>" '正文 .Attachments.Add "d:\1.txt" '附件 .Send '执行发送 End With End Sub