-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmail.js
More file actions
30 lines (22 loc) · 1007 Bytes
/
mail.js
File metadata and controls
30 lines (22 loc) · 1007 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
import nodemailer from "nodemailer";
import dotenv from 'dotenv';
dotenv.config();
var transfer = nodemailer.createTransport({
service: "gmail", //gönderici mail in kullandığı servis
auth: {//gönderici mail in bilgileri
user: "mertbaba.okulmus.010@gmail.com",
pass: process.env.pass
}
})
var mailBilgi = {
from: "mertbaba.okulmus.010@gmail.com",
to: "mertbaba.okulmus@hotmail.com,matamatik-kimya@hotmail.com",
subject: "Ateş Avcıları",
html: "<h1>Dikkat 1 nolu ateş avcısından tenlikeli durum algılandı</h1><strong>Daha detaylı bilgi için lütfen <a href='https://atesavcilari.herokuapp.com/posts'>Atesavcılari.com</a> adresini ziyaret ediniz!</strong>" //mail içeriğine html tağları da yazabiliyoruz, text özelliği gibi kullana biliyoruz
};
export const gonder = async() => {
await transfer.sendMail(mailBilgi, function (error) {
if (error) console.log(error)
else console.log("Mailiniz gönderildi!!")
})
}