Cant Send Email With Correct Characters With Phpmailer
I'm trying to send a e-mail with the PHPmailer class, but the html i send, is empty, or the characters are unconfigured, and without accents.
Solution 1:
Double check Your PHP code is also in UTF-8 encoding.
Uncomment the line //$mail->CharSet="UTF-8";
and move it idealy right after the $mail = new PHPMailer(true);
, so the code would look like:
// ...$mail = new PHPMailer(true);
$mail->CharSet = "UTF-8";
// ...
In Your code it is called after the $mail->Send();
thus the charset setting did not take in count...
Solution 2:
Yes, right after the "new PHPMailer(true);". I had the same problem with:
$mail = new PHPMailer(true);
try {
$mail->setLanguage('fr', 'inc'.DIRECTORY_SEPARATOR.'PHPMailer'…);
$mail->CharSet = 'UTF-8';
and changing to:
$mail = new PHPMailer(true);
$mail->CharSet = 'UTF-8';
try {
$mail->setLanguage('fr', 'inc'.DIRECTORY_SEPARATOR.'PHPMailer'…);
solved the accents problem.
Post a Comment for "Cant Send Email With Correct Characters With Phpmailer"