下面的代码多年来一直在向我们的打印履行人员发送CSV。本周初,系统管理员从sendmail切换到qmail,原因与我们要运行的procmail配方有关。
很可能不是巧合,我们开始听说履行人们看到空的CSV,即使其他CCED在邮件看到记录。有问题的人看到了附件,可以打开它,但他们的MUI将其列为131字节或零字节。
我们开始用同样的结果发送到雅虎地址。但是,gmail看到的附件行正确。请注意,这是所有一个CCED电子邮件,根据邮件客户的不同结果。
我已经检查了vi中的代码,并确保没有^m字符或其他控制字符垃圾。
以前有人见过这个吗?欢迎提出任何建议!
谢谢!
$message = "Here is the file (comma-separated values) of addresses for\n";
$message .= $pm_row['title'] . " Requests ($now_YmdHMS).\n\n";
$data_email = $pm_row['fulfillment_data_email'];
$data_email_cc = "$pm_row[fulfillment_data_email_cc],$developer_email";
$subject = $pm_row['title'] . " Requests ($now_YmdHMS)";
$random_hash = md5(date('r', time()));
$headers = "From: XXX <tourism@xxx.org>\r\nReply-To: tourism@xxx.org\r\nCc:$data_email_cc";
$headers .= "\nContent-Type: multipart/mixed; boundary=\"PHP-mixed-".$random_hash."\"";
$attachment = chunk_split(base64_encode(file_get_contents($filename)));
$output = "
--PHP-mixed-$random_hash;
Content-Type: multipart/alternative; boundary='PHP-alt-$random_hash'
--PHP-alt-$random_hash
Content-Type: text/plain; charset='iso-8859-1'
Content-Transfer-Encoding: 7bit
$message
--PHP-alt-$random_hash
Content-Type: text/html; charset='iso-8859-1'
Content-Transfer-Encoding: 7bit
$message
--PHP-alt-$random_hash--
--PHP-mixed-$random_hash
Content-Type: application/zip; name=$now_YmdHMS.$pm_row[handle].csv
Content-Transfer-Encoding: base64
Content-Disposition: attachment
$attachment
--PHP-mixed-$random_hash--";
mail($data_email, $subject, $output, $headers);