forked from Marak/node_mailer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
demo-template.js
31 lines (28 loc) · 1007 Bytes
/
demo-template.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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 : undefined, // username
password : undefined // password
},
function(err, result){
if(err){ console.log(err); }
});
}