05-08-2012, 11:30 AM
For me the below script is working fine.
Code:
Set olapp = CreateObject("Outlook.Application")
Set olns = olapp.GetNameSpace("MAPI")
Set msg = olapp.CreateItem(mailitem)
Set rep = msg.Recipients.Add ("abc@qtp.com")
msg.subject = "Test Mail"
msg.body = "Mail from QTP"
fattach = "Z:\Results\Result.xml"
msg.Attachments.Add (fattach)
msg.send