Force phpmailer to send mail with an empty body

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

Saying:

$mail->Body = "";

php Mailer returns Message body empty

How to get phpMailer to send messages without body message?

Here is the full 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();
+4
source share
1 answer

Simple fix:

$mail->AllowEmpty = true;
+10
source

All Articles