-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtest.js
34 lines (31 loc) · 1.17 KB
/
test.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
32
33
var nu = require('nodeutil');
var ip = 'localhost';
//var mailer = require('nodeutil').mailutil;
var nodemailer = require('nodemailer');
var transporter = nodemailer.createTransport({"host":ip, "port": 25});
/*
mailer.init(
{"smtpOptions":{"host":ip, "port": 2525}, "sender": "NO-REPLY <[email protected]>"}
);
*/
console.log(transporter);
transporter.sendMail({
//from: "NO-REPLY <[email protected]>",
from: "micloud <[email protected]>",
//cc:["[email protected]"],
subject: "micampus-test123..." + new Date().toString(),
html:"<h1>TEST123</h1>",
//bcc:["[email protected]","[email protected]"],
//to:["[email protected]"] ,
to:["[email protected]"] ,
attachments: [//see detail: https://github.com/andris9/Nodemailer#attachment-fields
{ // utf-8 string as an attachment
fileName: "text1.txt",
contents: "hello world!"
},
{ // binary buffer as an attachment
fileName: "text2.txt",
contents: new Buffer("hello world!","utf-8")
}]
});