ataman-m06-03 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of ataman-m06-03 might be problematic. Click here for more details.
- package/m06-03.js +45 -0
- package/package.json +11 -0
package/m06-03.js
ADDED
@@ -0,0 +1,45 @@
|
|
1
|
+
// const sendmail = require('sendmail')({silent: true, smtpHost: 'localhost'});
|
2
|
+
|
3
|
+
// function send(x) {
|
4
|
+
// sendmail({
|
5
|
+
// from: 'vintageparts2022@gmail.com',
|
6
|
+
// to: 'vintageparts2022@gmail.com',
|
7
|
+
// subject: 'test sendmail',
|
8
|
+
// html: x
|
9
|
+
// }, function (err, reply) {
|
10
|
+
// console.log(err && err.stack);
|
11
|
+
// console.dir(reply);
|
12
|
+
// });
|
13
|
+
// }
|
14
|
+
|
15
|
+
// module.exports = { send:send };
|
16
|
+
|
17
|
+
|
18
|
+
const nodemailer = require("nodemailer");
|
19
|
+
|
20
|
+
async function send() {
|
21
|
+
|
22
|
+
let transporter = nodemailer.createTransport({
|
23
|
+
host: 'smtp.gmail.com',
|
24
|
+
port: 465,
|
25
|
+
secure: true, // use SSL
|
26
|
+
auth: {
|
27
|
+
user: 'vintageparts2022@gmail.com',
|
28
|
+
pass: 'eobswkbloxyrnvyi'
|
29
|
+
}
|
30
|
+
});
|
31
|
+
|
32
|
+
// password: eobswkbloxyrnvyi
|
33
|
+
let info = await transporter.sendMail({
|
34
|
+
from: 'vintageparts2022@gmail.com',
|
35
|
+
to: 'maksdadapayr@mail.ru',
|
36
|
+
subject: "Test nodemailer",
|
37
|
+
text: "Hello world!",
|
38
|
+
html: "<b>Hello world!</b>",
|
39
|
+
});
|
40
|
+
|
41
|
+
console.log("Message sent: %s", info.messageId);
|
42
|
+
|
43
|
+
}
|
44
|
+
|
45
|
+
module.exports = { send:send };
|