Ask a Question

Failing to send an email through TestComplete

Ravikaanth0606
New Contributor

Failing to send an email through TestComplete

Hi team,

I trying to send a report through email but I am getting socket error. Please check the below code for your reference. Your ideas are appreciated. Thanks in advance.

 

Error:

JavaScript runtime error.

Socket Error # 10054
Connection reset by peer.

 

Code:

if(SendMail("receivermailid@squaredatalabs.com","smtp.hostinger.com","sendername","sendermailid@squaredatalabs.com","Test Report","Please find the attached report","file path"))

{
Log.Message("Mail was sent");
}

else
{
Log.Warning("Mail was not sent");
}

5 REPLIES 5
rraghvani
Champion Level 2

Is that the exact code you are using? The last parameter, you are passing in string called "file path"?

Thanks for your reply,

I am using my system file path. For example I mentioned like file path

Actual path is - "E:\\MBTEST\\MBAutomation\\Report.html"

rraghvani
Champion Level 2

Send an email without attaching a file, just to test whether your email exchange system allows it. Usually, email exchange systems are setup to stop third party software from sending emails.

Yes tried without attaching a file I getting the same socket error

Error:

JavaScript runtime error.

Socket Error # 10054
Connection reset by peer.
 
 
rraghvani
Champion Level 2

Your email exchange system is rejecting the email. It's probably best to speak to your IT, to see if they can allow this.

cancel
Showing results for 
Search instead for 
Did you mean: