-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.js
More file actions
31 lines (30 loc) · 880 Bytes
/
test.js
File metadata and controls
31 lines (30 loc) · 880 Bytes
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
const emailjs = require("emailjs");
module.exports = function email(options) {
this.add("area:email,action:send", (args, done) => {
var server = emailjs.server.connect({
user: "1187712426@qq.com",
password: "dqmwdlcyijtwbagi",
host: "smtp.qq.com",
ssl: true
});
// send the message and get a callback with an error or details of the message that was sent
server.send(
{
from: "1187712426@qq.com",
to: "1261435326@qq.com",
subject: "邮件服务测试",
text:"send the message and get a callback with an error or details of the message that was sent"
},
(err, msg) => {
if (err) {
done(null, { err });
return;
}
done(null, { msg });
}
);
});
this.wrap("area:email", function(msg, respond) {
this.prior(msg, respond);
});
};