Forum Discussion

OlgaV's avatar
OlgaV
Occasional Contributor
9 years ago

Runtime error on SendMail

Hello!

I am constantly getting the Runtime error when running this short python script in TestComplete:

 

def sendResults():
   SendMail("xxx@gmail.com", "mail.xxx.com", "Test Execute", "xxx@gmail.com", "Test", "Hello", "C:\Test-results\test.txt")

 

Any suggestions?

 

TestComplete V: 11.20

OS: Windows 7 Enterprise

Attached is the screenshot of the error message.

  • I'm assuming you're sending via a company email address or something?

     

    Have you checked that the mail server is open? It sounds like it's timing out on your mail server and eventually rejecting ....

  • chrisb's avatar
    chrisb
    Regular Contributor

    A quick Google search tells me you need to use authentication on the Google SMTP server, therefore you will need to use CDO as per these instructions:

     

    https://support.smartbear.com/viewarticle/67749/

     

    Assuming authentication wasnt required your example still wouldnt work as you didnt include the SMTP server address which is one of the argumnets in the SendMail method.

    • Colin_McCrae's avatar
      Colin_McCrae
      Community Hero

      Scrap this reply. I mis-read the order of the arguments!

       

      I've only ever used CDO myself ....