Thomas1703
Thomas1703

Reputation: 1172

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();

Upvotes: 6

Views: 3202

Answers (1)

Synchro
Synchro

Reputation: 37770

Easy fix:

$mail->AllowEmpty = true;

Upvotes: 13

Related Questions