mailsender

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

Usage no npm install needed!

<script type="module">
  import mailsender from 'https://cdn.skypack.dev/mailsender';
</script>

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.