All of a sudden (this was working fine last week) I've started getting Error sending mail: Error: connect EADDRNOTAVAIL when trying to send emails with Nodemailer.
The error is really vague and I'm not quite sure what EADDRNOTAVAIL means. If anybody could shed some light on this error, that would be great!
I've been bugged by this problem for over half a day now. Here's the solution!
Nodemailer has just been through a major update and the format in which the transporter is specified has changed. So instead of
var smtpTransport=nodemailer.createTransport("SMTP",{host:'some host',port:25});
it is now just
var smtpTransport=nodemailer.createTransport({host:'some host',port:25});
This link (http://www.toptip.ca/2010/02/linux-eaddrnotavail-address-not.html) seems like it might help. Basically it says that under load your mailer, which opens an outgoing connection, exhausts the local ports available, and suggests ways to increase. HTH.