利用OUTLOOK发邮件的脚本

上一篇 / 下一篇  2009-03-03 20:00:31 / 个人分类:自动化测试QTP

Dim objOutlook
Dim objOutlookMsg
Dim olMailItem
' Create the Outlook object and the new mail object.
Set ōbjOutlook = CreateObject("Outlook.Application")
Set ōbjOutlookMsg = objOutlook.CreateItem(olMailItem)
Set mapi = objOutlook.GetNameSpace("MAPI")
' Define mail recipients
objOutlookMsg.To = "my@email.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"
'Display the email
objOutlookMsg.Display
' Send the message
objOutlookMsg.Send
' Release the objects
objOutlook.quit
Set ōbjOutlook = Nothing
Set mapi = Nothing

TAG:

 

评分:0

我来说两句

Open Toolbar