С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;;
}
Posted in PHP

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

Leave a Reply

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

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>