Hi All,
I am writing a script like below to send email via outlook. I am getting a general run error on line 10 (ObjMailItem.send).
Can anybody tell me where am I going wrong? I am using Microsoft Outlook version 2003, with Service Pack3 and QTP Version 9.5.
Thanks in advance.
Regards,
Reema.
I am writing a script like below to send email via outlook. I am getting a general run error on line 10 (ObjMailItem.send).
Code:
1. Dim objOutl
2. Set WshShell = CreateObject("WScript.Shell")
3. Set objOutl = CreateObject("Outlook.Application")
4. Set objMailItem = objOutl.CreateItem(olMailItem)
5. objMailItem.Display
6. strEmailAddr = "abc@gmail.com"
7. objMailItem.to = strEmailAddr
8. objMailItem.Body = "Hi"
9objMailItem.Attachments.Add"D:\Result\Result.csv"
10. objMailItem.send
11. Set objMailItem = nothing
12. Set objOutl = nothing
Can anybody tell me where am I going wrong? I am using Microsoft Outlook version 2003, with Service Pack3 and QTP Version 9.5.
Thanks in advance.
Regards,
Reema.