feat: allow selecting tls or ssl for email notifications (#237)

This commit is contained in:
Miguel Ribeiro
2024-03-17 22:56:30 +01:00
committed by GitHub
parent e1cc9254ac
commit 2462435743
19 changed files with 63 additions and 7 deletions
+7 -1
View File
@@ -23,6 +23,12 @@ if ($_SERVER["REQUEST_METHOD"] === "POST") {
];
echo json_encode($response);
} else {
$enxryption = "tls";
if (isset($data["encryption"])) {
$encryption = $data["encryption"];
}
require '../../libs/PHPMailer/PHPMailer.php';
require '../../libs/PHPMailer/SMTP.php';
require '../../libs/PHPMailer/Exception.php';
@@ -41,7 +47,7 @@ if ($_SERVER["REQUEST_METHOD"] === "POST") {
$mail->SMTPAuth = true;
$mail->Username = $smtpUsername;
$mail->Password = $smtpPassword;
$mail->SMTPSecure = 'tls';
$mail->SMTPSecure = $encryption;
$mail->Port = $smtpPort;
$getUser = "SELECT * FROM user WHERE id = 1";