phpmailer PDF附件突然作为文本附件发送

时间:2013-03-16 00:20:42

标签: phpmailer

我们有一个cript,以PDF格式向我们邮寄附件。 工作多年,突然停止工作。

PDF现在已经创建并邮寄,但不会以PDF格式邮寄,而是以文本文件的形式邮寄,扩展名为.txt。

    $mail_handler = new PHPMailer(); // defaults to using php "mail()"
//$mail_handler->Body = $contents_mail_handler;
$mail_handler->Body = $contents_mail_handler;

$mail_handler->From = MAIL_SENDER;
$mail_handler->FromName = MAIL_SENDER;
$mail_handler->Subject = "#$inserted_order_id: $name - € $total";
$mail_handler->AddAddress($email_handler, $email_handler); 

$file_nl = "_orders/" . $filename_nl;
$mail_handler->AddAttachment($file_nl,$filename_nl);             // attachment

$file_en = "_orders/" . $filename_en;
$mail_handler->AddAttachment($file_en,$filename_en);             // attachment

$file_fr = "_orders/" . $filename_fr;
$mail_handler->AddAttachment($file_fr,$filename_fr);             // attachment

$mail_handler->Send();
$mail_handler->ClearAddresses();
$mail_handler->ClearAttachments(); 

文字附件内容示例:http://pastebin.com/tdfKfQCq

非常感谢任何帮助,谢谢! BAS

1 个答案:

答案 0 :(得分:0)

感谢。路径很好。更新了phpmailer,修复了问题。