0
votes

I am trying to send an email using phpmailer https://github.com/PHPMailer/PHPMailer to send an email via SMTP. There is a requirement that the email has no content in the body, only an attatchment.

If I neglect to include $body or set $body = '' then I get an error message telling me that 'Mailer Error: Message body empty'

Does anybody know of a workaround or a way to force PHPMailer to accept a blank body>?

2
how about $body = ' '; ?user557846

2 Answers

2
votes

use this: $body = " "; or $body = ";nbsp";

1
votes

It's just a class so make your own subclass, copy the method that throws that error and comment out the check for it. That way you don't need to touch the library.