Any suggestion for smtp mail server in nodejs?

2019-01-30 03:50发布

问题:

I googled out quite a few but all are at best alpha versions, so it seems I will have to try an code one. Instead of coding one from scratch I would like to build on existing implementation, but a good one.

Any suggestions?

回答1:

SMTP server - I've used Simple SMTP in conjunction with mailparser. IMHO, these are the best tools on the Internet for building SMTP servers in Node.js.

UPDATE: Simple SMTP has been deprecated. Use SMTP server instead (the successor of the Simple SMTP module).



回答2:

Haraka: https://github.com/baudehlo/Haraka

Is a full featured mail server in node.js - should do everything that you need.



回答3:

RFC 2821 (http://tools.ietf.org/html/rfc2821) is not too complex, you should be able to flesh out a server in about 300 lines of js.



回答4:

Some answers here are quite outdated, so I'd like to offer the lastest.

There are currently three Node SMTP servers (libraries) I know of:

  • Haraka (which has been mentioned and is quite robust/heavy)
  • smtp-server (this is the successor to the deprecated Simple SMTP project)
  • smtp-protocol

There's also mailin which is an SMTP server that receives messages and posts them to some URL for you to process. Mailin uses Python for some optional features.



回答5:

Personally, I use node_mailer :

send emails from node.js to your smtp server, simple as cake.

From https://github.com/marak/node_mailer :

Features :

  • super simple api
  • emails are blasted out asynchronously
  • uses connection pooling per SMTP server
  • super simple built in templates using Mustache.js
  • SSL supported (NodeJS v0.3.x or later)


标签: smtp node.js