05-16-2011, 03:32 PM
Hi
Iam using below code in qtp to send myautomation results
my problem here is, when i open outlook the code is working fine
but when i close outlookand run the code its giving general run time error.
at Mail.send, i think basically its not able to choose the profile.
can you please help how to open the profile using qtp code.
Iam using below code in qtp to send myautomation results
my problem here is, when i open outlook the code is working fine
but when i close outlookand run the code its giving general run time error.
at Mail.send, i think basically its not able to choose the profile.
can you please help how to open the profile using qtp code.
Code:
Call fnSendMail()
Public Function fnSendMail()
Set oUtlookApp=CreateObject("Outlook.Application")
Set Mail= oUtlookApp.CreateItem(0)
Mail.to= gstrEmailAddress
Mail.Subject=gstrEmailSubject
Mail.Body=gstrEmailBody
' Mail.Attachments.Add(gstrResultFileName)
Mail.Send
'oUtlookApp.Quit
Set oUtlookApp = Nothing
Set Mail = Nothing
End Function