Znaki w treści wiadomości działają poprawnie jedynie mam problem z TEMATEM wiadomości. W $subject jest brak polskich znaków. Próbowałem już encode utf i nic z tego. Gdzie tkwi błąd ?
$to = 'xxxx@tlen.pl' ;
$subject = ' zgłoszenie';
// 'UTF-8'
// mb_detect_encoding($subject, 'UTF-8', true); // false
$msg = "$name: \n" . "$mailer_other" . "<b>$nr_zgloszenia</b>";
// To send HTML mail, the Content-type header must be set
// Additional headers
$headers .= 'From: koloroskop <x@x.pl>' . "\r\n";
$headers .= 'Bcc: birthdaycheck@example.com' . "\r\n";
$headers .= "Content-type: text/html; charset=utf-8\n";
$headers .= "Content-Transfer-Encodin: 8bitr\n";
mail($to, $subject, $msg, $headers); $tekst = 'Dziękujemy za wysłanie zgłoszenia. Wkrótce odpowiemy na twoje pytanie. Kliknij <a href="index.php">TUTAJ</a> aby wrócić do strony głównej.';
}
}
Problem rozwiązałem funkcją. Może komuś się przyda
function mail_utf8($to, $subject = '(No subject)', $msg = '', $headers = '') {
$header_ = 'MIME-Version: 1.0' . "\r\n" . 'Content-type: text/plain; charset=UTF-8' . "\r\n";
}
Pozdrawiam
kolejna sprawa do tego tematu. Dodając <img src=\"http://xxxxx.pl/wp-content/themes/xxxxx/img/moje-miasto.jpg\" alt=\"Angry face\" title=\"Angry face\" /> na poczatku $msg google traktuje jako spam tlen już nie. Jak zatem dodawać IMG do listu aby gmail nie traktował tego jako spam.?