Skip to content
This repository
Browse code

[docs] Added template demo example.

  • Loading branch information...
commit 16241c9a4506b21675ec281d403d53d263144f26 1 parent 54a3409
authored

Showing 1 changed file with 30 additions and 0 deletions. Show diff stats Hide diff stats

  1. +30 0 demo-template.js
30 demo-template.js
... ... @@ -0,0 +1,30 @@
  1 +var email = require("./lib/node_mailer");
  2 +
  3 +for(var i = 0; i < 10; i++){
  4 +
  5 + email.send({
  6 + host : "localhost", // smtp server hostname
  7 + port : "25", // smtp server port
  8 + domain : "localhost", // domain used by client to identify itself to server
  9 + to : "marak.squires@gmail.com",
  10 + from : "obama@whitehouse.gov",
  11 + subject : "node_mailer test email",
  12 + template : "./templates/sample.txt", // path to template name
  13 + data : {
  14 + "username": "Billy Bob",
  15 + "color": function(){
  16 + var arr = ["purple", "red", "green", "yello"];
  17 + return arr[Math.floor(Math.random()*3)];
  18 + },
  19 + "animal": "monkey",
  20 + "adverb": "quickly",
  21 + "noun": "hot lava"
  22 + },
  23 +
  24 + username : "dXNlcm5hbWU=", // Base64 encoded username
  25 + password : "cGFzc3dvcmQ=" // Base64 encoded password
  26 + },
  27 + function(err, result){
  28 + if(err){ console.log(err); }
  29 + });
  30 +}

0 comments on commit 16241c9

Please sign in to comment.
Something went wrong with that request. Please try again.