0

我们有一个以 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

任何帮助都非常感谢,谢谢!巴斯

4

1 回答 1

0

谢谢。路径还可以。更新了phpmailer,修复了问题。

于 2013-03-16T11:23:52.450 回答