Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Error while sending email via outlook
#1
Solved: 10 Years, 9 Months, 1 Week ago
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).

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.
Reply


Messages In This Thread
Error while sending email via outlook - by reejais - 10-27-2010, 05:54 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Send automatic email notification when test run started helmzshelmz 0 926 04-03-2020, 07:54 AM
Last Post: helmzshelmz
  Sending json file request and validating response in soap UI tool using Groovy script smiley 0 3,663 07-19-2017, 04:58 PM
Last Post: smiley
  How to attach HTML file to Email Naresh 0 2,743 04-06-2015, 02:04 PM
Last Post: Naresh
  Help getting Sender Name from Email nidhitaneja 0 1,980 06-15-2014, 09:03 AM
Last Post: nidhitaneja
  Clicking a link in an outlook email using QTP kirti 0 5,371 06-15-2014, 01:25 AM
Last Post: kirti

Forum Jump:


Users browsing this thread: 1 Guest(s)