Micro Focus QTP (UFT) Forums

Full Version: Unable to send an email from Outlook which is already opened as draft
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

I want to send an email with attachment from outlook which is already opened as draft email with TO address & subject. Also want to Open and take a screenshot of the received Auto generated email in Inbox.

I have a code to send an email with attachment but i am not able to Open a received email, is there is any code for that.

Code:
Set OlAPP = CreateObject("Outlook.Application")
Set Olns = OlApp.GetNameSpace("MAPL")
Olns = Logon
Set ObjFolder = Olns.GetDefaultFolder(6)
ObjFolder.Display
Set msg = OlApp.CreateItem(OlMailItem)
Set Recpt = msg.Recipients.Add("vijayram143@gmail.com")
msg.Attachments.Add "FilePath"
msg.Send
OlAPP.Quit
Set OlApp = Nothing
Set Olns = Nothing