Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Send Mail Errors
#1
Solved: 11 Years, 4 Months ago
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.


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
Reply
#2
Solved: 11 Years, 4 Months ago
your code is trying to send email without logging, it only works when you a Outlook opened in your machine so that it will be authenticated automatocally.

Please authenticate your user please sending email
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How to send/pass UFT Run Error Dialog as output value to main driver script lravi4u 0 592 11-05-2023, 03:55 PM
Last Post: lravi4u
  Send automatic email notification when test run started helmzshelmz 0 1,078 04-03-2020, 07:54 AM
Last Post: helmzshelmz
  Web Testing and Unexpected Server Errors zunebuggy 0 1,278 01-24-2018, 11:41 PM
Last Post: zunebuggy
  To send Fail Results to mail Naresh 1 2,543 04-23-2015, 08:30 PM
Last Post: babu123
  To send the QTP Results to mail using Thunderbird Naresh 0 2,406 04-03-2015, 03:19 PM
Last Post: Naresh

Forum Jump:


Users browsing this thread: 1 Guest(s)