Forum Discussion

npathak's avatar
npathak
Occasional Contributor
14 years ago

Failed to send email through script in TestComplete

Hi,



I went through your help which is about how to send email through script. I referred below link for that :

http://support.smartbear.com/viewarticle/12301/



However, it didn't worked for me.

I tried both approach,



1. Used built-in "sendMail"

In this case I encountered below error:

An exception occurred in the "myscript" unit at line
18:

SendMail

Socket Error # 10013

Access denied.



Used below code for that:





Call SendMail("myname@mycompany.com", "localhost" , "myName", "myemailaddress@mycompany.com","Notification", "Hello , Your application is nice.")


   
2. Used Collaboration Data Objects (CDO) for sending email &

In this case I encountered below error:

An exception occurred in the "myscript" unit at line
73:

CDO.Message.1

The transport failed to connect to the server.



Could you help me in finding the real cause of failure so that I can send email through my automation script.



-Thanks,

Naval

6 Replies

  • npathak's avatar
    npathak
    Occasional Contributor
    Thanks Jackson.

    As you suggested I tried with SMTP server name as the 'FromHost' rather than 'localhost' , but it didn't worked.

    Even I tried with my smtp server which in my case is "smtp.mycompany.com" & it didn't worked either.



    Since am novice user , its quite possible that I missed couple of thing here. :-)
  • Hello Naval,

    In both cases, can you try specifying your SMTP server name as the 'FromHost' rather than 'localhost'.



    Cheers,

    Jackson
  • TonyM's avatar
    TonyM
    Occasional Contributor
    Hi,



    Any updates about sending emails? I'm running into the same issues.



    Thanks.
  • TonyM's avatar
    TonyM
    Occasional Contributor
    Hi,



    Any updates about sending emails? I'm running into the same issues.



    Thanks.
  • I use the CDO method Mike linked to in his post. Works perfectly for me.