0

I m facing some character encoding issues like this:

D\\\'Huison-Longueville Référence 

Original Text was :

D'Huison-Longueville Référence 

Here is my PHP Mailer script:

                 $mail = new PHPMailer();
                 $mail->CharSet = 'UTF-8';
                 $mail->IsMail();
                 $mail->Subject = $subject;
                 $mail->IsHTML(true);
                 $mail->Body = $email_body;
                 $mail->From='[email protected]';
                 $mail->FromName= "Support Team";
                 $mail->AddAddress($toEmail);
                 $mail->Send();

1 Answer 1

2

I had the same problem. The charset was not being changed although I was specifying the new one like you with:

$mail->CharSet = 'UTF-8';

Since you use "IsMail" you have to go to the folder where class.phpmailer.php resides (generally in the same folder as the main phpmailer.php file) and edit it. There you will see the default values for the mail and you will see that it is set to "ISO-8859-1".

Change

public $CharSet = 'ISO-8859-1';

to

public $CharSet = 'UTF-8';

Change it to "UTF-8" or any other charset you want.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.