我正在使用PHPMailer
API 发送电子邮件。我想知道如何以阿拉伯语(非英语)语言发送主题
$mail->CharSet = 'utf-8';
$array= FetchTable('cos');
$subject = $_POST['subject'];
$body = $_POST['body'];
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->Host = "host";
$mail->SMTPAuth = true;
$mail->Username = "yaz@enfaltourism.com";
$mail->Password = "*******";
$mail->Port = "587";
$mail->From = "yaz@enfaltourism.com";
$mail->FromName = "Enfaltourism";
$mail->Subject = $subject;
$mail->AddAddress($email);
$mail->Send();`
电子邮件已成功发送,但问题在于以阿拉伯语发送主题。设置字符编码后,电子邮件正文以阿拉伯语正确显示,但主题以奇怪的字符显示
更新
include("../mail/class.phpmailer.php");
$array= FetchTable('cos');
$subject = $_POST['subject'];
$body = $_POST['body'];
$mail = new PHPMailer();
$mail->CharSet = 'utf-8';
$mail->IsSMTP();
$mail->Host = "mail.enfaltourism.com";
$mail->SMTPAuth = true;
$mail->Username = "yaz@enfaltourism.com";
$mail->Password = "*****";
$mail->Port = "587";
$mail->From = "yaz@enfaltourism.com";
$mail->FromName = "Enfaltourism";
$mail->Subject = $subject;
我按照你说的修好了,但这个主题仍然很奇怪