• Stars
    star
    208
  • Rank 189,015 (Top 4 %)
  • Language
    JavaScript
  • Created almost 8 years ago
  • Updated over 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

An example of using Nodemailer with RabbitMQ

Nodemailer AMQP example

This is an example of using RabbitMQ (amqplib) for queueing Nodemailer email messages. This allows you to push messages from your application quickly to delivery queue and let Nodemailer handle the actual sending asynchronously from a background process.

This example also demonstrates using different credentials for different messages using the same Nodemailer transport.

Setup

Download files from Github

$ git clone git://github.com/nodemailer/nodemailer-amqp-example.git
$ cd nodemailer-amqp-example

Install required dependencies

$ npm install --production

Make sure that you have a RabbitMQ server running (default config assumes RabbitMQ running on localhost with default credentials) and also check the configuration options in config.json.

Running

The example contains 3 different parts:

  1. Example SMTP server (server.js). This is where Nodemailer sends the messages to. The server prints message source to console and does not actually deliver anything
  2. Subscriber process (subscriber.js). This is the worker process that fetches queued messages from RabbitMQ and delivers these using Nodemailer. You can spawn up as many subscriber processes as you want, even though a single one should be fine in most cases.
  3. Publisher process (publisher.js). This is an example application process that pushes message data to RabbitMQ for delivery. Normally it would be the job of your application.

Run all processes in different windows, using the following execution order:

$ npm run server
$ npm run subscribe
$ npm run publish

Example

More Repositories

1

nodemailer

✉️ Send e-mails with Node.JS – easy as cake!
JavaScript
16,582
star
2

wildduck

Opinionated email server
JavaScript
1,888
star
3

mailparser

Decode mime formatted e-mails
JavaScript
1,578
star
4

smtp-server

Create custom SMTP servers on the fly
JavaScript
854
star
5

mailcomposer

Composes e-mails from structured data
212
star
6

nodemailer-smtp-transport

SMTP transport for nodemailer
JavaScript
206
star
7

nodemailer-wellknown

Well-known SMTP server configuations
JavaScript
152
star
8

wildduck-webmail

Demo webmail service for WildDuck Mail Server
Handlebars
146
star
9

nodemailer-ses-transport

AWS SES transport for Nodemailer
JavaScript
130
star
10

smtp-connection

SMTP client for node.js
JavaScript
123
star
11

wildduck-dockerized

Wildduck: dockerized - 🦆+🐋=❤
Shell
100
star
12

nodemailer-smtp-pool

Pooled SMTP transport for Nodemailer
JavaScript
48
star
13

nodemailer-sendgrid

SendGrid transport for Nodemailer
JavaScript
44
star
14

addressparser

Parse e-mail address fields with node.js
40
star
15

nodemailer-app

Releases for NodemailerApp, the ultimate email debugging tool
30
star
16

libmime

MIME functions
JavaScript
27
star
17

nodemailer-dkim

DKIM signing for Nodemailer
JavaScript
26
star
18

haraka-plugin-wildduck

Wild Duck plugin for Haraka
JavaScript
26
star
19

nodemailer-sendmail-transport

Sendmail transport for Nodemailer
JavaScript
24
star
20

buildmail

Build and stream mime messages
19
star
21

mailcast

Self hosted list management and newsletters
JavaScript
18
star
22

nodemailer-openpgp

Encrypt Nodemailer messages with PGP
JavaScript
17
star
23

nodemailer-direct-transport

Nodemailer transport for sending emails directly to recipient MX server
16
star
24

zonemta-wildduck

Wild Duck MSA plugin for ZoneMTA
JavaScript
14
star
25

wildduck-mta

Example MTA service for Wild Duck mail Server
JavaScript
12
star
26

import-maildir

Import maildir contents to WildDuck
JavaScript
11
star
27

wild-config

Application configuration management module
JavaScript
10
star
28

libbase64

Base64 encoder and decoder for node
JavaScript
10
star
29

nodemailer-web

Source for www.nodemailer.com
HTML
7
star
30

libqp

Quoted-Printable encoder and decoder for node
JavaScript
6
star
31

nodemailer-ntlm-auth

NTLM authentication module for Nodemailer
JavaScript
5
star
32

wildduck-audit-manager

Audit manager web interface for WildDuck
JavaScript
4
star
33

browserbox2

Some minimal patches to browserbox
JavaScript
2
star
34

nodemailer-fetch

Fetch HTTP URL contents for nodemailer attachments
2
star
35

wildduck-audit-client

WildDuck audit client
JavaScript
1
star
36

nodemailer-shared

Shared methods for the nodemailer stack
1
star
37

nodemailer-cram-md5

CRAM-MD authentication addon for Nodemailer
JavaScript
1
star