Z najnowszym phpmailer (11.2009,
http://sourceforge.net/projects/phpmailer/...0for%20php5_6/) nie ma żadnych problemów z polskimi znakami. A ten patch już jest dodany. Może klient pocztowy ma problemy z utf8? TB/gmail www wszystko działa.
Kod którego używałem
<?php
require_once 'class.phpmailer.php';
require_once 'class.smtp.php';
$mail = new PHPMailer(true); // the true param means it will throw exceptions on errors, which we need to catch
$mail->IsSMTP(); // telling the class to use SMTP
try {
$mail->SMTPAuth = true; // enable SMTP authentication
$mail->SMTPSecure = "ssl"; // sets the prefix to the servier
$mail->Host = "smtp.gmail.com"; // SMTP server
$mail->Port = 465; // set the SMTP port
$mail->Username = "ABCDE@gmail.com"; // SMTP account username
$mail->Password = "haslo"; // SMTP account password
$mail->SetFrom('ABCDE@gmail.com', 'ABCDE');
$mail->AddAddress('dokogo@gmail.com', 'XYZ');
$mail->Subject = 'ŁÓDŹ ąśćźńół';
$mail->Body = 'ŁÓDŹ ąśćźńół';
$mail->SetLanguage('pl', 'language/');
$mail->CharSet = 'utf-8';
$mail->IsHTML(false);
$mail->WordWrap = 100;
/**
* Gdy HTML
* $mail->AltBody = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test
* $mail->MsgHTML($body);
* $mail->MsgHTML(file_get_contents('contents.html'));
*/
/*
// Załączniki
$mail->AddAttachment("images/phpmailer.gif"); // attachment
$mail->AddAttachment("images/phpmailer_mini.gif"); // attachment
*/
$mail->Send();
echo "Wiadomość wysłana!\n"; } catch (phpmailerException $e) {
echo $e->errorMessage(); //Error od Phpmailer } catch (Exception $e) {
echo $e->getMessage(); //Inny error }
?>