Search code examples
node.jsemailamazon-ec2gmailnodemailer

Ways of making a rock solid email for massive sending inside nodejs app?


I'm having a big problem using a Gmail account (with our company domain) and Nodemailer in a Node.js app. We use this one email to send approximately 1000 mails a day, and is going to continue to grow...

The problem is that some of these mails will arrive two days late (which is crucial for our app) and some other wont even be received by the destination user, and there's no way (at least that we know of) to know which users received the emails and which not since in Gmail all mails are marked as sent.

Its just an inconsistent freight train every day!

Things we have tried:

  • Enabling less secure apps (of course)
  • Having a try catch block, and a second email on the catch to retry if there's an error
  • Disabling less secure apps and using OAuth2

Non of the above have worked

We are using:

  • NodeJS
  • nodemailer
  • AWS (to host app)
  • handlebars (The body of the emails consists of html, images and links)

Any one of you have any experience with a similar situation, or a known way to make a rock solid email account for massive sending?


Solution

  • I'm having a big problem using a Gmail account... and nodemailer... to send approximately 1000 mails a day

    Using a Gmail account is your big problem.

    Gmail isn't designed for this use case and it doesn't perform well under these conditions. Use something that's designed for high-volume programmatic mail delivery, like SendGrid or Mailgun, instead. Since you're already in the AWS ecosystem, SES might be a good match, too.

    Nodemailer plays nicely with all of those services, and all three provide robust delivery metrics.