]> git.mxchange.org Git - friendica-addons.git/commitdiff
[phpmailer] Ensure encoding is UTF-8 even when not using the SMTP configuration
authorHypolite Petovan <hypolite@mrpetovan.com>
Sun, 29 Nov 2020 20:41:46 +0000 (15:41 -0500)
committerHypolite Petovan <hypolite@mrpetovan.com>
Sun, 29 Nov 2020 20:41:46 +0000 (15:41 -0500)
phpmailer/phpmailer.php

index 3f6f5f5f4e51b0067ea46ce729ae425872f9a089..25b9404716de5b90b920bd47e4eb06c7809372e8 100644 (file)
@@ -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');