smtp without username password

This commit is contained in:
LouisLam 2021-07-13 11:01:02 +08:00
parent edbab8163e
commit 0f1a95fde9

View File

@ -135,15 +135,20 @@ class Notification {
static async smtp(notification, msg) {
let transporter = nodemailer.createTransport({
let data = {
host: notification.smtpHost,
port: notification.smtpPort,
secure: notification.smtpSecure,
auth: {
};
if (notification.smtpUsername) {
data.auth = {
user: notification.smtpUsername,
pass: notification.smtpPassword,
},
});
};
}
let transporter = nodemailer.createTransport(data);
// send mail with defined transport object
let info = await transporter.sendMail({