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
Post a Comment