Archive. Date of access: 12 Jan 2022

Marak Squires 78537c77ed [dist] Bump to v0.6.7 13 years ago
lib 59903633dc fixed HTML template issue (templates from cache not sent as HTML). simple refactor. allow for log level (debug, default is false) to be set per message. nodemailer package.json version is 0.1.20 13 years ago
templates 59903633dc fixed HTML template issue (templates from cache not sent as HTML). simple refactor. allow for log level (debug, default is false) to be set per message. nodemailer package.json version is 0.1.20 13 years ago
vendor 183e038a31 [api] added the abiltity to do mustache templating. bumped to 0.4.0 14 years ago
Changelog d1347677ce [fix] dont send plaintext for templates since we expect them to be html, this should help w/ some of the more esoteric email clients 14 years ago
MIT-LICENSE b096fb71e3 cleaned up lib some more, added npm install instructions 14 years ago
Readme.md d1347677ce [fix] dont send plaintext for templates since we expect them to be html, this should help w/ some of the more esoteric email clients 14 years ago
demo-template-html.js 59903633dc fixed HTML template issue (templates from cache not sent as HTML). simple refactor. allow for log level (debug, default is false) to be set per message. nodemailer package.json version is 0.1.20 13 years ago
demo-template.js 59903633dc fixed HTML template issue (templates from cache not sent as HTML). simple refactor. allow for log level (debug, default is false) to be set per message. nodemailer package.json version is 0.1.20 13 years ago
demo.js 59903633dc fixed HTML template issue (templates from cache not sent as HTML). simple refactor. allow for log level (debug, default is false) to be set per message. nodemailer package.json version is 0.1.20 13 years ago
logo.png d273146350 [misc] Added logo to project, updated ReadMe 14 years ago
package.json 78537c77ed [dist] Bump to v0.6.7 13 years ago
stubSMTP ca611674cf updated demo and docs, bumped to version 0.3.0 14 years ago

Readme.md

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

Installing npm (node package manager)

 curl http://npmjs.org/install.sh | sh

Installing say.js

 npm install mailer

FEATURES

  • super simple api
  • emails are blasted out asynchronously
  • uses connection pooling per SMTP server
  • super simple built in templates using Mustache.js

REQUIRES

  • SMTP Server

USAGE

  var email = require("../lib/node_mailer");

  for(var i = 0; i < 10; i++){

    email.send({
      host : "localhost",              // smtp server hostname
      port : "25",                     // smtp server port
      ssl: true,                        // for SSL support - REQUIRES NODE v0.3.x OR HIGHER
      domain : "localhost",            // domain used by client to identify itself to server
      to : "marak.squires@gmail.com",
      from : "obama@whitehouse.gov",
      subject : "node_mailer test email",
      body: "Hello! This is a test of the node_mailer.",
      authentication : "login",        // auth login is supported; anything else is no auth
      username : "my_username",        // username
      password : "my_password"         // password
    },
    function(err, result){
      if(err){ console.log(err); }
    });
  }

USING SSL

This fork supports SSL connections. To use it, add an option ssl: true. See usage above.

USING TEMPLATES

create a simple template

/templates/sample.txt

  Hello {{username}}, 

  This is a sample template of the node mailer.

  It uses mustache templating to do basic search and replaces. 

  The {{color}} {{animal}} {{adverb}} ran over the {{noun}}.

then send the mail using some simple JSON based Mustache replacement.

  var email = require("../lib/node_mailer");

  for(var i = 0; i < 10; i++){

    email.send({
      host : "localhost",               // smtp server hostname
      port : "25",                     // smtp server port
      domain : "localhost",             // domain used by client to identify itself to server
      to : "marak.squires@gmail.com",
      from : "obama@whitehouse.gov",
      subject : "node_mailer test email",
      template : "../templates/sample.txt",   // path to template name
      data : {
        "username": "Billy Bob",
        "color": function(){
          var arr = ["purple", "red", "green", "yello"];
          return arr[Math.floor(Math.random()*3)];
        },
        "animal": "monkey",
        "adverb": "quickly",
        "noun": "hot lava"
      },

      authentication : "login",        // auth login is supported; anything else is no auth
      username : "my_username",        // username
      password : "my_password"         // password
    },
    function(err, result){
      if(err){ console.log(err); }
    });
  }

Authors

Marak Squires, Elijah Insua, Fedor Indutny, Bradley Meck