'发邮件
Dim objOutlook
Dim objOutlookMsg
Dim olMailItem
' Create the Outlook object and the new mail object.
Set objOutlook = CreateObject("Outlook.Application")
Set objOutlookMsg = objOutlook.CreateItem(olMailItem)
Set mapi = objOutlook.GetNameSpace("MAPI")
' Define mail recipients
objOutlookMsg.To = "1111111@qq.com;aaa@aaa.com"
'objOutlookMsg.CC = "my@email.com"
' objOutlookMsg.BCC = "my@email.com"
' Body of the message
objOutlookMsg.Subject = "QTP Test Mail"
objOutlookMsg.Body = "This is a test mail"
'添加附件
'ReportLocation ="e:"
' Attachment =ReportLocation&"rarTest"
'objOutlookMsg.Attachments.Add(Attachment)
'Display the email
objOutlookMsg.Display
' Send the message
objOutlookMsg.Send
' Release the objects
'objOutlook.quit
Set objOutlook = Nothing
Set mapi = Nothing