Failing to send an email through TestComplete
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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:
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");
}
- Labels:
-
Script Tests
-
Test Results
-
Web Testing
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Is that the exact code you are using? The last parameter, you are passing in string called "file path"?
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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"
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes tried without attaching a file I getting the same socket error
Error:
Socket Error # 10054
Connection reset by peer.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Your email exchange system is rejecting the email. It's probably best to speak to your IT, to see if they can allow this.
