Sunday, 10 March 2013

How to send mail from outlook in qtp


How to send mail from outlook in qtp
Code mentioned below will send mail to aTO from outlook. Make sure that outlook is open before you run this code.

'create an outlook object
Set Outlook = CreateObject("Outlook.Application")
Dim Message

'create a mail object
Set Message = Outlook.CreateItem(0)

With Message

'display the mail
.display

'set the subject of the mail
.Subject = "Subject"

'set the body of the mail
.HTMLBody = "TextBody"

'add the recipients for the mail
.Recipients.Add "reply2sagar@gmail.com"

'to add the attachments to mail use below line of code.
'.attachments.Add "f:\class.txt"

'send the mail.
.Send
End With









No comments:

Post a Comment

Please Leave your reply. We value your feedback and inputs

Best QTP Books

Everything About QTP

Hello Friends,
You can find QTP study material, Multiple choice questions (mcq), QTP question bank, QTP question papers, QTP notes, QTP questionnaire, scenario based QTP interview questions, QTP tutorial and QTP training on this site.

If you are a fresher or experienced QTP professional with (1/2/3/4) years of experience, this blog is just for you.