From 341e51f13d89596bc6217c46462ed7a0da24ba77 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Sun, 29 Nov 2020 15:41:46 -0500 Subject: [PATCH] [phpmailer] Ensure encoding is UTF-8 even when not using the SMTP configuration --- phpmailer/phpmailer.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/phpmailer/phpmailer.php b/phpmailer/phpmailer.php index 3f6f5f5f..25b94047 100644 --- a/phpmailer/phpmailer.php +++ b/phpmailer/phpmailer.php @@ -37,14 +37,14 @@ function phpmailer_emailer_send_prepare(App $a, IEmail &$email) // Passing `true` enables exceptions $mailer = new PHPMailer(true); try { + // Setup encoding. + $mailer->CharSet = 'UTF-8'; + $mailer->Encoding = 'base64'; + if (DI::config()->get('phpmailer', 'smtp')) { // Set mailer to use SMTP $mailer->isSMTP(); - // Setup encoding. - $mailer->CharSet = 'UTF-8'; - $mailer->Encoding = 'base64'; - // Specify main and backup SMTP servers $mailer->Host = DI::config()->get('phpmailer', 'smtp_server'); $mailer->Port = DI::config()->get('phpmailer', 'smtp_port'); -- 2.39.5