【转】QTP使用outlook发邮件

上一篇 / 下一篇  2010-03-04 23:26:27 / 个人分类: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 = "QTPTest 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