我想知道如何允许以下带有mail()函数的脚本运行时使用抛光字母中使用的变音符号,如:ą,ś,ć,ź,ż等。
麻烦的是,不知何故收到的电子邮件的标题是完全正常的,其中实际的电子邮件内容根本不处理抛光字母。
<?php
$headers = "MIME-Version: 1.0\n";
$headers .= "Content-type: text/html; charset=ISO-8859-2\n";
$headers .= "Content-Transfer-Encoding: 8bit\n";
$receiver = "testmail@gmail.com";
$title = "Title in polish - Przykładowy tekst wiadomości mail";
$message = "Ąą, Ćć, Ęę, Łł, Ńń, Óó, Śś, Żż, Źź";
$from = "myemail@mydomain.com";
$header = "From: " .$from;
mail($receiver, $title, $message, $header);
echo "Ok!";
?>
答案 0 :(得分:1)
您已在邮件功能中发送$ header,但不包括$ header内容。
答案 1 :(得分:-1)
你可以试试PHP mail()函数
// Code without trick
$subject = "I Love You ❤";
// You will end up with junk character in subject
mail("email@receiver.com",$subject,"This email subject will contain JUNK characters.");
// Code with trick
$subject = "I Love You ❤";
$updated_subject = "=?UTF-8?B?" . base64_encode($subject) . "?=";
mail("email@receiver.com",$updated_subject,"This email subject should not contain JUNK characters.")