nodemailer.com Open in urlscan Pro
2606:4700:30::681b:b26f  Public Scan

Submitted URL: http://www.nodemailer.com/
Effective URL: https://nodemailer.com/about/
Submission: On September 06 via api from US

Form analysis 2 forms found in the DOM

POST https://www.paypal.com/cgi-bin/webscr

<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
  <input type="hidden" name="cmd" value="_s-xclick">
  <input type="hidden" name="hosted_button_id" value="DB26KWR2BQX5W">
  <input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donate_SM.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!" style="display: inline">
  <img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>

POST https://www.paypal.com/cgi-bin/webscr

<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
  <input type="hidden" name="cmd" value="_s-xclick">
  <input type="hidden" name="hosted_button_id" value="DB26KWR2BQX5W">
  <input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donate_SM.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
  <a href="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" data-featherlight="image"><img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1"></a>
</form>

Text Content

Powered by Outfunnel

 * 1. Nodemailer
   * Migration
   * License
 * 2. Usage
   * SMTP? Say what?
   * Using Gmail
   * Delivering bulk mail
 * 3. Message configuration
   * Attachments
   * Alternatives
   * Address object
   * Calendar events
   * Embedded images
   * List headers
   * Custom headers
   * Custom source
 * 4. SMTP transport
   * SMTP envelope
   * Pooled SMTP
   * Testing SMTP
   * OAuth2
   * Custom authentication
   * Proxy support
   * Delivery status notifications
 * 5. Other transports
   * Sendmail transport
   * SES transport
   * Stream transport
 * 6. Plugins
   * Create plugins
 * 7. DKIM
 * 8. Extra modules
   * SMTP Server
   * SMTP Connection
   * Mailparser
   * Mailcomposer
   * Node.js daemons




Nodemailer > Nodemailer


NODEMAILER

Nodemailer is a module for Node.js applications to allow easy as cake email
sending. The project got started back in 2010 when there was no sane option to
send email messages, today it is the solution most Node.js users turn to by
default.

Nodemailer is licensed under MIT license. See license details in the License
page. If you are upgrading from Nodemailer v2 or older, then see the light
migration guide here.

npm install nodemailer



SUPPORT NODEMAILER

If you really like Nodemailer or your business benefits from it financially then
I would really appreciate a small donation. You can either use Bitcoin or PayPal
for donations.

My Bitcoin wallet is: 15Z8ADxhssKUiwP3jbbqJwA21744KMCfTM.




NODEMAILER FEATURES

 * A single module with zero dependencies – code is easily auditable, as there
   are no dark corners
 * Heavy focus on security, no-one likes RCE vulnerabilities
 * Unicode support to use any characters, including emoji 💪
 * Windows support – you can install it with npm on Windows just like any other
   module, there are no compiled dependencies. Use it hassle free from Azure or
   from your Windows box
 * Use HTML content, as well as plain text alternative
 * Add Attachments to messages
 * Embedded image attachments for HTML content – your design does not get
   blocked
 * Secure email delivery using TLS/STARTTLS
 * Different transport methods in addition to the built-in SMTP support
 * Sign messages with DKIM
 * Custom Plugin support for manipulating messages
 * Sane OAuth2 authentication
 * Proxies for SMTP connections
 * ES6 code – no more unintentional memory leaks, due to hoisted var’s
 * Autogenerated email test accounts from Ethereal.email

REQUIREMENTS

 * Node.js v6.0.0 or newer. That’s it.

If you are able to run Node.js version 6 or newer, then you can use Nodemailer.
There are no platform or resource specific requirements. All public Nodemailer
methods support both callbacks and Promises (if callback is omitted). You need
to have at least Node v8.0.0 if you want to use async..await with Nodemailer.

TL;DR

In short, what you need to do to send messages, would be the following:

 1. Create a Nodemailer transporter using either SMTP or some other transport
    mechanism
 2. Set up message options (who sends what to whom)
 3. Deliver the message object using the sendMail() method of your previously
    created transporter

EXAMPLE

This is a complete example to send an email with plain text and HTML body

'use strict';
const nodemailer = require('nodemailer');

// async..await is not allowed in global scope, must use a wrapper
async function main() {
    // Generate test SMTP service account from ethereal.email
    // Only needed if you don't have a real mail account for testing
    let testAccount = await nodemailer.createTestAccount();

    // create reusable transporter object using the default SMTP transport
    let transporter = nodemailer.createTransport({
        host: 'smtp.ethereal.email',
        port: 587,
        secure: false, // true for 465, false for other ports
        auth: {
            user: testAccount.user, // generated ethereal user
            pass: testAccount.pass // generated ethereal password
        }
    });

    // send mail with defined transport object
    let info = await transporter.sendMail({
        from: '"Fred Foo 👻" <foo@example.com>', // sender address
        to: 'bar@example.com, baz@example.com', // list of receivers
        subject: 'Hello ✔', // Subject line
        text: 'Hello world?', // plain text body
        html: '<b>Hello world?</b>' // html body
    });

    console.log('Message sent: %s', info.messageId);
    // Message sent: <b658f8ca-6296-ccf4-8306-87d57a0b4321@example.com>

    // Preview only available when sending through an Ethereal account
    console.log('Preview URL: %s', nodemailer.getTestMessageUrl(info));
    // Preview URL: https://ethereal.email/message/WaQKMgKddxQDoou...
}

main().catch(console.error);



EXAMPLES

 * Nodemailer AMQP example is an example of using RabbitMQ to manage Nodemailer
   email messages. Source.

Output of the the example script as shown by the Ethereal mail catching service:




SOURCE

Nodemailer source can be found from Github.

--------------------------------------------------------------------------------

Nodemailer is created by Andris Reinman. The Nodemailer logo was designed by
Sven Kristjansen.