Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Outlook using QTP
#13
Solved: 10 Years, 9 Months ago
Please find the below code u would be able to send the mail through qtp


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

Code:
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 = "venkat.batchu@xxxx.com" ' Message recipient Address

Set oUtlookApp = CreateObject("Outlook.Application")

Set nAmeSpace = oUtlookApp.GetNamespace("MAPI")

Set newMail = oUtlookApp.CreateItem(0)

Subject = "Test Results of Login and Signoff" 'Message Subject you can update

Body = "To view the test results of login and signoff. " 'Message body you can update

newMail.Subject = Subject

newMail.Body = Body & vbCrLf

newMail.Recipients.Add(ToAddress)

newMail.Attachments.Add("C:\Documents and Settings\venkat.batchu\Desktop\Results\Log\LogFile.html") 'You can update attachment file name

newMail.Send

Set nAmeSpace = Nothing

Set oUtlookApp = Nothing

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


Enjoy by sending mails through qtp..
Reply


Messages In This Thread
Outlook using QTP - by dsharma - 01-21-2008, 09:15 AM
RE: Outlook using QTP - by dsharma - 01-21-2008, 05:10 PM
RE: Outlook using QTP - by Rajashekar Gouda - 01-21-2008, 05:16 PM
RE: Outlook using QTP - by chrism2202 - 01-23-2008, 02:17 AM
RE: Outlook using QTP - by keyurpathak - 04-04-2008, 01:44 AM
RE: Outlook using QTP - by vamshiram - 06-25-2008, 07:09 PM
RE: Outlook using QTP - by deeps_aj - 09-23-2008, 06:43 PM
RE: Outlook using QTP - by srivania - 09-25-2008, 02:32 PM
RE: Outlook using QTP - by navyasatish - 07-18-2008, 07:21 AM
RE: Outlook using QTP - by venkatbatchu - 10-20-2009, 04:20 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Extracting Email Body from Outlook waseem.khan.91 0 1,911 03-04-2019, 02:53 PM
Last Post: waseem.khan.91
  Extracting Email Body from Outlook waseem.khan.91 0 1,035 03-01-2019, 02:51 PM
Last Post: waseem.khan.91
  Unable to send an email from Outlook which is already opened as draft attiliv 0 2,150 03-24-2013, 11:14 AM
Last Post: attiliv
  Outlook automation issue - Report message in a shared mail box chsurya 0 2,588 03-11-2011, 06:33 PM
Last Post: chsurya
  MS OutLook Email Notification nelmanoj 0 2,385 12-27-2010, 01:05 PM
Last Post: nelmanoj

Forum Jump:


Users browsing this thread: 1 Guest(s)