December 2, 2011 | In: Programovanie
utf-8 mail v php – phpmailer
phpmailer s utf-8 – diakritikou
jedine čo potrebujete je asi CharSet… anyway, cely mejl…
require ‘class.phpmailer.php’;
$mail = new PHPMailer(true);
$body = file_get_contents(‘nl.html’); // nas html document s obrazkami
$body = preg_replace(‘/\\\\/’,”, $body);
$mail->IsSMTP();
$mail->SMTPAuth = true;
$mail->Port = 25;
$mail->Host = “localhost”;
$mail->CharSet = ‘UTF-8’;
$mail->AddAddress(‘kuko@example.com’); // komu 😉
$mail->Subject = ‘Neaká diakříťika’;
$mail->WordWrap = 80;
$mail->MsgHTML($body);
$mail->IsHTML(true);
$mail->Send();
Comments are closed.