Force phpmailer to send mail with empty body

谁说胖子不能爱 提交于 2019-12-04 03:56:20

问题


I need to send an pdf file as attachment to a FAX gateway using phpMailer. If this email has a body, the fax will have a second page with this text.

By saying:

$mail->Body = "";

php Mailer returns Message body empty

How can I force phpMailer to send emails without a body message?

Here the complete code

$mail = new PHPMailer();
$emailto = $_POST['sendto'].'@gateway.provider.xy';
$pdf_filename = 'PDF_list_'.date('dmY').'.pdf';
/*
STMP Auth...
*/
$mail->From = $fmail;
$mail->FromName = $row_firma['company'];
$mail->AddAddress($emailto);
$mail->AddAttachment($pdf_filename);
$mail->Subject = "Subject";
$mail->Body = "";
$mail->AltBody = "";
$mail->Send();

回答1:


Easy fix:

$mail->AllowEmpty = true;


来源:https://stackoverflow.com/questions/29251753/force-phpmailer-to-send-mail-with-empty-body

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!