php - Mailer Error: Message body empty -


this question has answer here:

i can't, life of me, figure out why i'm receiving error. code below:

    require_once('lib/phpmailer/phpmailerautoload.php');                                     $mail = new phpmailer();                                     $mail->issmtp(); $mail->smtpauth = true; $mail->host = "smtp.gmail.com"; $mail->port = 26; $mail->username = "email@email.com"; $mail->password = "scrambled"; $mail->setfrom('email@email.com', 'web app'); $mail->subject = "a transactional email web app"; $mail->ishtml(false); $mail->msghtml($body); $mail->addaddress('email@email.com', 'nomination');                         if($mail->send()) {   echo "message sent!"; } else {   echo "mailer error: " . $mail->errorinfo; }                

someone please help!

$mail->body = 'blablabla'; 

also

$mail->ishtml(false); $mail->msghtml($body); 

sort of "no. yes". remove second line.


Comments

Popular posts from this blog

python - pip install -U PySide error -

arrays - C++ error: a brace-enclosed initializer is not allowed here before ‘{’ token -

cytoscape.js - How to add nodes to Dagre layout with Cytoscape -