From c21c46bdc8d9f145813a31750a1858d013e09050 Mon Sep 17 00:00:00 2001
From: Thibault Dockx <thibault.dockx@fusiondirectory.org>
Date: Tue, 12 Nov 2024 12:07:15 +0000
Subject: [PATCH] :sparkles: Feat(Integrator) - mail lib can now process accent
 properly

Encoding UTF-8.
---
 src/FusionDirectory/Mail/MailLib.php | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/FusionDirectory/Mail/MailLib.php b/src/FusionDirectory/Mail/MailLib.php
index b6ab1e1..476a3aa 100644
--- a/src/FusionDirectory/Mail/MailLib.php
+++ b/src/FusionDirectory/Mail/MailLib.php
@@ -50,12 +50,16 @@ class MailLib
     $this->mail->isSMTP();
     $this->mail->Host = $_ENV["MAIL_HOST"];
 
+    // Set UTF-8 character encoding
+    $this->mail->CharSet  = 'UTF-8';
+    // Set base64 for non UTF-8 char
+    $this->mail->Encoding = 'base64';
+
     /*
      * In case there are FQDN errors responses by the SMTP server, try below.
      * $this->mail->Helo = '['.$_SERVER['SERVER_ADDR'].']';
      */
 
-
     // Authentication mechanism
     if ($_ENV["MAIL_AUTH"] == "TRUE") {
       $this->mail->SMTPAuth = TRUE;
-- 
GitLab