5

So I have a server with ip, domain(www.example-sato.com), and have a nodejs/express.js app running on it.

When user registers I would like to send an email to the user with an sender like no-reply@example-sato.com.

What generally should I do?

  1. should I install postfix in my server?
  2. or should I install some npm package, then set in express.js?
Sato
  • 8,192
  • 17
  • 60
  • 115

1 Answers1

4

What I've used and find extremely easy to setup is nodemailer npm package. It has built-in SMTP transport, as well as the ability to use external ones. And it works pretty well on Windows, if that's a concern to you.

Installing postfix is an option, but you will still need npm package in order to use it. With nodemailer you can even use external STMP (or other) servers, like Gmail for example, which is very handy while in development. I mean you can use it with whatever mail server you want, if you don't like the built-in one :)

Andrey Popov
  • 7,362
  • 4
  • 38
  • 58
  • nodemailer looks great, built-in SMTP is what I want, so I can set something like `sender=auto-reply@example-sato.com` in expressjs app and if users receive email the sender is what I set? – Sato Apr 07 '16 at 13:11
  • Of course the sender is exactly what you want :) Check the `from` option here: https://github.com/nodemailer/nodemailer#e-mail-message-fields – Andrey Popov Apr 07 '16 at 16:29