Answer the question
In order to leave comments, you need to log in
Why is the encoding of some letters in the letter incorrect?
Sending PhpMailer emails, example code:
$message = "mailtext";
if(phpnum()>=5)
require("class.phpmailer5.php");
else
require("class.phpmailer4.php");
$mail = new PHPMailer();
$mail->From = $main_smarty->get_config_vars('Email_From');
$mail->FromName = $main_smarty->get_config_vars(Email_Name');
$mail->AddAddress($this->email);
$mail->AddReplyTo($main_smarty->get_config_vars('Email_From'));
$mail->IsHTML(true);
$mail->Subject = $main_smarty->get_config_vars('Email_Subject_verification');
$mail->CharSet = 'utf-8';
$mail->MsgHTML( $message );
if(!$mail->Send())
Ñ �
or іÐ �
and sometimes spaces appear in the link, for example, I http: //ww.site.com
$message = iconv("UTF-8", "WINDOWS-1251", $message);
$message = mb_convert_encoding("UTF-8", "WINDOWS-1251", $message);
$message = mb_detect_encoding($message , mb_detect_order(), true) === 'UTF-8' ? $message : mb_convert_encoding($message , 'UTF-8');
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question