Can't able to send a file through email
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");
Log.Warning("Mail was not sent");
Please find the below error for your reference,
Socket Error # 10054
Connection reset by peer.
Have a look at https://bobcares.com/blog/ftp-socket-error-10054/ for possible solutions. Try sending an email without an attachment, does it work?
Note, your Email Server could be rejecting the email - you will need to consult with your IT.
@Marsha_R Yes, I tried with my Gmail id, Please check the below code,
if(BuiltIn.SendMail("firstname.lastname@example.org","smtp.gmail.com","Ravikaanth","email@example.com","Test Report","Please find the attached report","E:\\MBTEST\\MBAutomation\\new.txt"))
Also I tried without attaching the file, It shows below error
Unable to send email to the smtp.gmail.com server.
I don't think Gmail will allow you to send unauthenticated third party emails via their servers called open mail relay.
If you are connected to your network organisation, you might be able to send a third party email using your current credentials.