Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Sending QTP report to mail
#2
Solved: 11 Years, 4 Months, 3 Weeks ago
Hi,

Please try the following vb script and change the ToAddress and other variables accordingly. I think this will help you.

Code:
'=========================================================================

'Email generation VB Script snipet.
'NamitRayudu
'Pre requisite: MS Outlook apllication up running on the desktop
'----------------------------------------------------------------------------------

Dim ToAddress
Dim Subject
Dim Body
Dim Attachment
Dim oUtlookApp, nAmeSpace, newMail

'SystemUtil.Run "C:\Program Files\Microsoft Office\Office11\OUTLOOK.EXE" 'This line should be enabled if the Outlook on the desktop is not running

ToAddress = "abc@test.com" ' Message recipient Address

Set oUtlookApp = CreateObject("Outlook.Application")

Set nAmeSpace = oUtlookApp.GetNamespace("MAPI")

Set newMail = oUtlookApp.CreateItem(0)

Subject = "This is a test mail" 'Message Subject you can update

Body = "This the message for testing. " 'Message body you can update

newMail.Subject = Subject

newMail.Body = Body & vbCrLf

newMail.Recipients.Add(ToAddress)

newMail.Attachments.Add("C:\worklist.txt") 'You can update attachment file name

newMail.Send

Set nAmeSpace = Nothing

Set oUtlookApp = Nothing

'end of the email generation code===================================================================

Thanks,
NamitaRayudu
Reply


Messages In This Thread
Sending QTP report to mail - by vamshiram - 06-12-2008, 03:52 PM
RE: Sending QTP report to mail - by namitarayudu - 06-12-2008, 11:13 PM
RE: Sending QTP report to mail - by vamshiram - 06-13-2008, 01:59 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Need help on rdlc report automation using uft souvikghosh_diatm 0 1,366 05-25-2017, 09:51 PM
Last Post: souvikghosh_diatm
Rolleyes Urgent help with Gmail Sending mail feature nidhitaneja 2 2,943 03-05-2014, 09:39 PM
Last Post: nidhitaneja
  How To pick up the particular mail in Post Login Gmail page and click on Checkbox akhandesh 0 2,870 12-02-2013, 01:35 PM
Last Post: akhandesh
  Jasper Report Automation TAUSIF 0 5,027 10-03-2013, 03:30 PM
Last Post: TAUSIF
  Query for configuration of Mail Body section through VB/QTP prasanna.rathinam 1 3,102 09-19-2013, 12:03 PM
Last Post: ssvali

Forum Jump:


Users browsing this thread: 2 Guest(s)