Skip to content

Commit a04cc0f

Browse files
committedJul 18, 2024
feat: added new branch for 6th homework hw06-email. feat: added PATCH method for verify email
1 parent 1a58b6a commit a04cc0f

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed
 

‎lala.js

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import nodemailer from "nodemailer";
2+
import "dotenv/config";
3+
4+
const { MAIL_API_KEY, MAIL_FROM } = process.env;
5+
6+
const nodemailerConfig = {
7+
host: "smtp.ukr.net",
8+
port: 465,
9+
secure: true,
10+
auth: {
11+
user: MAIL_API_KEY,
12+
pass: MAIL_FROM,
13+
},
14+
};
15+
16+
const transport = nodemailer.createTransport(nodemailerConfig);
17+
18+
const email = {
19+
from: MAIL_API_KEY,
20+
to: "email address for who",
21+
subject: "topic of the letter",
22+
html: "<stron>Hi!</stron>",
23+
};
24+
25+
transport
26+
.sendMail(email)
27+
.then(() => {
28+
console.log("Email sent!");
29+
})
30+
.catch((err) => {
31+
console.log(err.message);
32+
});

0 commit comments

Comments
 (0)
Please sign in to comment.