Forum Discussion

Ravikaanth's avatar
Ravikaanth
Contributor
3 years ago

Can't able to send a file through email

Hi team,

 

I am trying to send a file through an email, but I am getting an socket error. Please help me to resolve this issue. Thanks in advance.

 

Please find the below code for your reference,

 

if(BuiltIn.SendMail("receiver mail id","smtp.hostinger.com","Ravikaanth N S","sender mail id","Test Report","Please find the attached report","E:\\MBTEST\\MBAutomation\\new.txt"))
{
Log.Message("Mail was sent");
}
else
{
Log.Warning("Mail was not sent");
}

 

Please find the below error for your reference, 

 

JavaScript runtime error.
Socket Error # 10054
Connection reset by peer.