Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Force phpmailer to send mail with empty body

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();
like image 313
Thomas1703 Avatar asked Mar 25 '15 09:03

Thomas1703


1 Answers

Easy fix:

$mail->AllowEmpty = true;
like image 106
Synchro Avatar answered Oct 31 '22 11:10

Synchro