php邮件程序不发送学位符号

php邮件程序不发送学位符号,php,urlencode,Php,Urlencode,好的,我有一个php mailer程序,它可以很好地发送html电子邮件,除非它们包含学位符号或符号 我认为这是一个编码问题,但无论我尝试什么,输出电子邮件都会在(包括)学位符号之后停止 请再给我一双眼睛好吗。以下是相关的php代码: $headers = "MIME-Version: 1.0" . "\n"; $headers .= "Content-type:text/html;charSet=utf-8" . "\n"; $headers .= "bcc: $emailList\r\n";

好的,我有一个php mailer程序,它可以很好地发送html电子邮件,除非它们包含学位符号或符号

我认为这是一个编码问题,但无论我尝试什么,输出电子邮件都会在(包括)学位符号之后停止

请再给我一双眼睛好吗。以下是相关的php代码:

$headers = "MIME-Version: 1.0" . "\n";
$headers .= "Content-type:text/html;charSet=utf-8" . "\n";
$headers .= "bcc: $emailList\r\n";
$headers .= "From: " . $data1. "<" . "xxx@gmail.com".">\r\n";
// next include a reply to
$headers .= "Reply-To: " . $data7 . "\r\n";
// often email servers won't allow emails to be sent to
// domains other than their own.  The return path here will
// often lift that restriction so, for instance, you could send
// email to a hotmail account. (hosting provider settings may vary)
// technically bounced email is supposed to go to the return-path email
$headers .= "Return-path: " . $data7. "\r\n";

// now we can add the content of the message to a body variable

$message = "<!DOCTYPE html>";
$message .= "<html><head><title>Online test - ".$data8."</title></head><body>";
$message .= "<p style='font-family:verdana;font-size:12px;color:blue'>".$data1.", you have attempted ".$data3. " questions";

$message .= " in ".$data4." minutes and ".$data5." seconds";

$message .= " and scored a total of ".$data2.".</p>";
$message .= " <p style='font-family:verdana;font-size:12px;color:blue'>Final percentage = ".$data6."%</p>\r\n\r\n";
$message .= "<p style='font-family:verdana;font-size:12px;color:blue'>The following questions were answered incorrectly: </p><hr /><ul>";

foreach($myWrongArray as $my_Array){
    $message .= "\r\n\r\n<li style='font-family:verdana;font-size:12px;color:teal'>".$my_Array."</li>";  
}
//$message = strip_tags($message);
$message .= "</ul><hr /></body></html>";
// finally, send the email
mail($sendTo, $subject, $message, $headers);
$headers=“MIME版本:1.0”。“\n”;
$headers.=“内容类型:text/html;字符集=utf-8”。“\n”;
$headers.=“密件抄送:$emailList\r\n”;
$headers.=“From:”$数据1。“\r\n”;
//下一步包括对
$headers.=“回复:”$数据7。“\r\n”;
//电子邮件服务器通常不允许将电子邮件发送到
//域以外的域。这里的返回路径将
//经常取消限制,例如,您可以发送
//向hotmail帐户发送电子邮件。(托管提供商设置可能会有所不同)
//从技术上讲,被退回的电子邮件应该转到返回路径电子邮件
$headers.=“返回路径:”$数据7。“\r\n”;
//现在我们可以将消息的内容添加到body变量中
$message=“”;
$message.=“在线测试-”$data8.“;
$message.=“

最终百分比=”..$data6.%

\r\n\r\n”; $message.=“

以下问题回答错误:


    ”; foreach($MyErrorArray作为$my_数组){ $message.=“\r\n\r\n
  • ”。“$my\u数组。”
  • ”; } //$message=带标签($message); $message.=“

”; //最后,发送电子邮件 邮件($sendTo、$subject、$message、$headers);
尝试使用
°
&这些也会被截断。符号与度符号具有相同的效果。如果字符串是“今天的温度是30ºC,阳光明媚”,那么如果您回显
$message
它看起来像预期的那样吗?我不知道如何从邮件文件回显,但当我将数组字符串发送到文本文件时,它也被截断,这让我想到,它可能无法从ajax正确地发送到php。但是,当使用alert(string)检查时,数组字符串在javascript中是完整的。请尝试替换此
邮件($sendTo,$subject,$message,$headers)与此:
echo$消息;模具()尝试使用
°
&这些也会被截断。符号与度符号具有相同的效果。如果字符串是“今天的温度是30ºC,阳光明媚”,那么如果您回显
$message
它看起来像预期的那样吗?我不知道如何从邮件文件回显,但当我将数组字符串发送到文本文件时,它也被截断,这让我想到,它可能无法从ajax正确地发送到php。但是,当使用alert(string)检查时,数组字符串在javascript中是完整的。请尝试替换此
邮件($sendTo,$subject,$message,$headers)与此:
echo$消息;模具()