Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

mailsender

Easily send E-Mail from your Node.js program.

mail, gmail, sendmail, send, mail, homepage, mail, sending, e-mail, notification

readme



Send E-Mail from Node.js with your GMail account to any e-mail recipient.

Usage explanation

  1. Get a GMail account from Google
  2. Google is somewhat restrictive how you ought to send mails, but there is a way to configure automated sending capabilities.
    Go to
    • "Settings"
    • "Accounts and import"
    • "Further Settings"
    • "Logon and security"
    • Activate "Less secure apps"
  3. Go to your node project folder and type npm install mailsender
  4. Use mailsender in your Node.js applicaton (copy&paste):
        var mailsender = require('mailsender');
        mailsender
            .from('user', 'pass')
            .to('x@y.z')
            .body('subject', 'message')
            .send();
        

Sending HTML E-Mail

Instead of
  .body('subject', 'message')
above, add a boolean as last argument:
  .body('subject', 'message', true)
That's it: Your message will be interpreted as HTML now.