Hi guys!
I have the next issue when I try to use nodemailer to send an email, the application runs ok.
{ [Error: 140194420910976:error:1408F10B:SSL routines:ssl3_get_record:wrong version number:../ssl/record/ssl3_record.c:331:
] code: 'ESOCKET', command: 'CONN' }
I’ve done deployment in a VPS, the characteristics are the following:
The credentials about my smtp server are:
I have a laravel application running with the same credentials on my vps, it send emails ok, but when use it with node js, I get error that I mention.
I’ve read all documentation about nodemailer even using all recomendation, but error gets block me.
Please, if anyone has had this error before and was able to fix it, I will be very grateful.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Heya,
Just came across this answer and decided to write some general guidelines for anyone who comes across this in the future despite the old question.
This often comes up because of a problem with the SSL version or an issue with the communication between your node.js application and your SMTP server.
One common solution is to try using different port numbers. For instance, port 465 is typically used for SMTP over SSL, while port 587 is used for STARTTLS, which upgrades a plain text connection to an encrypted (SSL or TLS) connection.
Do note that there’s a difference between ‘SMTPS’ and ‘SMTP’ with ‘STARTTLS’, where the former is SMTP over SSL/TLS from the start of the connection, whereas the latter upgrades at a later stage. If port 587 isn’t working, you might want to try using port 465 instead, if your email service provider supports it.
Finally, you might also want to verify that your firewall isn’t blocking connections on your chosen port.
For more information, you can refer to this DigitalOcean tutorial (even though it’s for Python’s smtplib library, the SMTP port details are universally applicable).
Hope that this helps!
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.