Sending email

In many platforms, the ability to send email comes standard, but the Node approach leaves the email functionality to the developer.

Thankfully, there are some excellent module creators in the Node community who have already created modules for sending email. In this recipe, we'll be using the well-featured third-party nodemailer module to send an imaginary newsletter to a list of recipients.

Getting ready

In order to send an email, we'll need a functioning SMTP server that we can connect to. In a later recipe, we'll be creating our own SMTP server, but for now we'll have to acquire some details of our SMTP to use our client with.

If we have an email address, we have access to an SMTP server. We can find out the SMTP host address from ...

Get Node Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.