From dd283423ab230862e2e3ee2514265c063b34e349 Mon Sep 17 00:00:00 2001 From: LouisLam Date: Thu, 9 Sep 2021 01:13:09 +0800 Subject: [PATCH] improve smtp with cc, bbc and ignore tls --- server/notification-providers/smtp.js | 7 ++- src/components/NotificationDialog.vue | 65 +++++------------------ src/components/notifications/SMTP.vue | 75 +++++++++++++++++++++++++++ 3 files changed, 93 insertions(+), 54 deletions(-) create mode 100644 src/components/notifications/SMTP.vue diff --git a/server/notification-providers/smtp.js b/server/notification-providers/smtp.js index 4914c0748..ecb583eb7 100644 --- a/server/notification-providers/smtp.js +++ b/server/notification-providers/smtp.js @@ -30,10 +30,15 @@ class SMTP extends NotificationProvider { // send mail with defined transport object await transporter.sendMail({ - from: `"Uptime Kuma" <${notification.smtpFrom}>`, + from: notification.smtpFrom, + cc: notification.smtpCC, + bcc: notification.smtpBCC, to: notification.smtpTo, subject: msg, text: bodyTextContent, + tls: { + rejectUnauthorized: notification.smtpIgnoreTLSError || false, + }, }); return "Sent Successfully."; diff --git a/src/components/NotificationDialog.vue b/src/components/NotificationDialog.vue index cd8ee8173..447b19266 100644 --- a/src/components/NotificationDialog.vue +++ b/src/components/NotificationDialog.vue @@ -37,7 +37,7 @@ - + @@ -65,49 +65,7 @@ - +