-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathemail.js
31 lines (31 loc) · 874 Bytes
/
email.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
/**
* nodejs email sihorton@gmail.com <pass> nodejs
*/
var nodemailer = require("../node_modules/nodemailer/lib/nodemailer.js");
var smtpTransport = nodemailer.createTransport("SMTP",{
service: "Gmail",
auth:{
user:process.argv[2]
,pass:process.argv[3]
}
});
var message = {
from:process.argv[2]
,to:"tcesubmit@gmail.com"
,subject: process.argv[4] + " extension submission"
,text: "Hi Tinycore,\n\nThis is an autogenerated email with attachment for the latest build of "+process.argv[4]+" extension.\n\n"
,attachments:[{
fileName:process.argv[4]+".tar.gz.bfe"
,filePath:__dirname+"/release/"+process.argv[4]+".tar.gz.bfe"
,cid:'nyan@node'
}]
}
console.log(message);
smtpTransport.sendMail(message, function(error) {
if (error) {
console.log("error sending email:" + error.message);
return;
}
console.log("message sent");
smtpTransport.close();
});