SendGrid-nodejs or Nodemailer?

stone picture stone · Mar 4, 2015 · Viewed 8.4k times · Source

There are at least two ways to send email from Nodejs using SendGrid:

  1. Sendgrid provides a Nodejs library called "SendGrid-nodejs." They're actively supporting Sendgrid-Nodejs (last update 29 days ago).
  2. Nodemailer supports sendgrid and seems to be extremely popular. SendGrid posted an article about using this combination: Sending email with Nodemailer and Sendgrid.

Edit 2

SendGrid have ended support for nodemailer-sendgrid-transport as of today.

So, if you're starting on a project now, I would suggest going with sendgrid-nodejs.


Original question:

Edit to make the question less opinion-based: What are the pros and cons to each approach? I have googled for days and not seen any comparison of the two. There is another StackOverflow question asking for differentiation between the two (among several other things) which has gone unanswered. So surely the answer to this will help others.

My specific usage, in case it helps focus the answers: I want to allow users of an iPhone app to invite others to use the app. They'll see the default invitation text in the app, and can customize it. The customized text is sent to my Nodejs server and added to a job queue. As the queue is processed, emails are sent. I want the emails to look nice, so I want to use HTML email templates (and a plaintext alternate body).

Scale-wise, this will start out very small but if the app is succssful could scale up rapidly.

Answer

Patrick picture Patrick · Mar 4, 2015

Well, sendgrid-nodejs is a more popular repository.

However, Nodemailer is the most popular module for sending emails with NodeJS. I've been using it for months and I'm very satisfied.

If you're worried about the future of your app you should consider that Nodemailer is used not just with Sendgrid, but with a lot of other competitors. So if you have a problem with Sendgrid, you could easily switch to another email delivery service without having to learn a different API.

So I suggest you to use nodemailer-sendgrid-transport, and if you find bugs, fix them with a PR :P