Сlass phpmailer — пишем сообшения на русском! utf-8

 

require("class.phpmailer.php");
$mail = new PHPMailer();
 
$mail->From=$from;
$mail->FromName="My site's mailer";
$mail->Sender=$from;
$mail->AddReplyTo("$to", "Replies for my site");

$mail->AddAddress("$to");
$mail->Subject = "$title"; 

#$mail->AddCustomHeader ('Content-Type: text/html; charset="utf-8"')  
$mail->CharSet = "utf-8";
$mail->IsMail();
$mail->IsHTML(true);

$mail->Body = "сообщение на русском";

$mail->AltBody="This is text only alternative body.";

if(!$mail->Send())
{
   echo "Error sending: " . $mail->ErrorInfo;;
}

1 комментарий

Добавить комментарий

Ваш e-mail не будет опубликован.