2

您好我正在尝试使用以下邮件功能发送电子邮件,但我希望编码也显示西班牙语字符。我怎样才能使$email_body它们以现在不起作用的状态显示它们:

$email_body = "body text"; 

$headers = 'From: ' . $m . "\r\n";
$headers .= 'Return-Path: ' . $m . "\r\n";
$headers .= 'MIME-Version: 1.0' ."\r\n";
$headers .= 'Content-Type: text/HTML; charset=ISO-8859-1' . "\r\n";
$headers .= 'Content-Transfer-Encoding: 8bit'. "\n\r\n";

mail($to,$email_subject,$email_body,$headers);
4

1 回答 1

1

好的添加了以下行,现在它正在工作:$email_body = mb_convert_encoding($email_body, "ISO-8859-1","AUTO");

于 2013-10-23T16:07:19.020 回答