Following is an example using SendGrid. You can get your free account here.
First, update your environment with your SENDGRID_API_KEY.
echo "export SENDGRID_API_KEY='YOUR_API_KEY'" > sendgrid.env
echo "sendgrid.env" >> .gitignore
source ./sendgrid.env
Here is the full working code.
To run the example:
node examples/example