AndroidDev
AndroidDev

Reputation: 21237

PHPMailer - Does body have to come from a file now?

I've been using PHPMailer successfully for a couple of years. I just refreshed my PHPMailer class from their github site, and now my server throws 500 errors. I tracked down the problem to this line (simplified for this post):

$mail->Body = "<p>Hello World</p>";

All of the example that I see on the worxware website these days show the body of the email being read from a file like this:

$body = file_get_contents('contents.html');
$body = eregi_replace("[\]",'',$body);
$mail->MsgHTML($body);

I also tried modifying my code to use the MsgHTML syntax, but I still have the same result:

$body = "<p>Hello World</p>";
$mail->MsgHTML($body);

I can't imagine that it matters whether this body gets populated from a file or from a local variable, but nothing that I try works. What am I missing? Thanks!

Upvotes: 0

Views: 142

Answers (1)

kailash sharma
kailash sharma

Reputation: 356

$output = str_replace(array("\n","\r"),"",$output);

try this

Upvotes: 1

Related Questions