简单的问题...
我看到有人告诉我在不同的地方使用"\r\n",而其他人告诉我在同一个地方使用"\n"。我确定其中一个是正确的,另一个是错误的。例如 - 当设计mail()头文件时:
教程#1:
//define the headers we want passed. Note that they are separated with \r\n
$headers = "From: webmaster@example.com\r\nReply-To: webmaster@example.com";
//add boundary string and mime type specification
$headers .= "\r\nContent-Type: multipart/mixed; boundary=\"PHP-mixed-".$random_hash."\"";
教程 #2(注意头部参数):
mail($to, $subject, $body,
"From: " . $from . "\n" .
"bcc: " . $bcc . "\n" .
"MIME-Version: 1.0\n" .
"Content-Type: multipart/alternative;\n" .
" boundary=" . $mime_boundary_header)
我有点困惑,但显然这会造成某种影响,因为用其中一种方式时我的标题起作用了,而用另一种方式时它们仅有时起作用。