Nodemailer: Easy e-mail sending from your Node.js applications
nodemailer.com
nodemailer.com
email.send({
host : "smtp.gmail.com", // smtp server hostname
port : "465", // smtp server port
ssl: true,
domain : "localhost", // domain used by client to identify itself to server
to : "recipient@somewhere.com",
from : 'sender@somewhere.com',
subject : 'My Subject',
body: 'Blah\nBlah\nBlah.,
authentication : "login", // auth login is supported; anything else is no auth
username : '',
password : ''
},
function (err, result) {
});Website does not seem to have a link to repo though: https://github.com/andris9/Nodemailer
If you happen to use this with AWS watch out though. It's hard coded to US east. If you're not in that region then you should configure the server manually to a local end point so that you don't have to pay for bandwidth. Would be a tad faster too.
[1]: https://github.com/andris9/Nodemailer/blob/master/lib/wellkn...
You can do so by removing `app.use(express.favicon());` from the generated app.js file. At the very least, you could add your own favicon in your public/ folder to make the project page look (albeit in the most vain sense) more polished.
Even with major providers there are enough occasional blips that you don't want to impact delivery of your email. Additionally, it would allow you to decouple sending (popping from the queue) if you ever needed to delay it momentarily.
For the queue, I've wrapped redis and rabbitmq clients with a simple retry logic that re-enqueues the job on failure to send. It's about choosing what's right for your use case.
Very easy to use and highly recommended!