Dim xOutLook
Dim xMail
Dim j1, j2
If InternetGetConnectedState(0&, 0&) Then
On Error Resume Next
Set xOutLook = GetObject(, "Outlook.Application")
If xOutLook Is Nothing Then
Set xOutLook = CreateObject("Outlook.Application")
End If
Set xMail = xOutLook.CreateItem(olMailItem)
With xMail
'Display
.To = "5*****@qq.com"
.Subject = "主题"
.HTMLBody = "测试文本"
.Importance = olImportanceHigh '重要级别:高
Dim xDoc
Set xDoc = xMail.Application.ActiveInspector.WordEditor
j1 = "E:\个人软件记录\11 弹出提醒\日常管理软件V1.3.4版本\今日提醒.ini" '添加附件1
j2 = "C:\1.txt" '添加附件2
.Attachments.Add j1
.Attachments.Add j2
.Send
End With
End If
这个需要首先配置outlook的账号