php - Why is either PHPMailer or SendMail not working? -


i have php script uses phpmailer:

require("phpmailer/phpmailerautoload.php"); $mail = new phpmailer(); $mail->issmtp(); $mail->smtpauth = false; $mail->issendmail(); $mail->host = "localhost"; $mail->port = 587;  $mail->setfrom($from, 'buzzzap');  $mail->subject = $subject; $mail->msghtml($body); $mail->addaddress($to, $to); if ($mail->send()) {     echo "message sent!";     return true; } else {     echo "mailer error: " . $mail->errorinfo;     return false; } 

(some variables defined elsewhere, defined) so, have sendmail running on port 25 , 587 (says when run netstat -tulnp) on live server. script "successfully sent" , produces no errors, warnings, etc. mail.log shows:

 8 17:33:23 casparwylie sendmail[2601]: u18hxnfd002601: authentication-warning: casparwylie: www-data set sender billing@buzzzap.com using -f feb  8 17:33:23 casparwylie sendmail[2601]: u18hxnfd002601: from=billing@buzzzap.com, size=2178, class=0, nrcpts=1, msgid=<5e0e6f2a4e12ddb8524541a13b2a76a1@buzzzap.com>, relay=www-data@l$ feb  8 17:33:23 casparwylie sm-mta[2602]: u18hxnk9002602: from=<billing@buzzzap.com>, size=2393, class=0, nrcpts=1, msgid=<5e0e6f2a4e12ddb8524541a13b2a76a1@buzzzap.com>, proto=esmtp, dae$ feb  8 17:33:23 casparwylie sendmail[2601]: u18hxnfd002601: to="casparwylie@googlemail.com" <casparwylie@googlemail.com>, ctladdr=billing@buzzzap.com (33/33), delay=00:00:00, xdelay=00:0$ feb  8 17:33:23 casparwylie sm-mta[2604]: starttls=client, relay=gmail-smtp-in.l.google.com., version=tlsv1/sslv3, verify=fail, cipher=ecdhe-rsa-aes128-gcm-sha256, bits=128/128 feb  8 17:33:24 casparwylie sm-mta[2604]: u18hxnk9002602: to=<casparwylie@googlemail.com>, delay=00:00:01, xdelay=00:00:01, mailer=esmtp, pri=122393, relay=gmail-smtp-in.l.google.com. [7$ feb  8 17:33:26 casparwylie sendmail[2606]: u18hxqoo002606: authentication-warning: casparwylie: www-data set sender billing@buzzzap.com using -f feb  8 17:33:26 casparwylie sendmail[2606]: u18hxqoo002606: from=billing@buzzzap.com, size=2178, class=0, nrcpts=1, msgid=<2a08b37d9e3ea189c1e61648a3e2e5f8@buzzzap.com>, relay=www-data@l$ feb  8 17:33:26 casparwylie sm-mta[2607]: u18hxqxe002607: from=<billing@buzzzap.com>, size=2393, class=0, nrcpts=1, msgid=<2a08b37d9e3ea189c1e61648a3e2e5f8@buzzzap.com>, proto=esmtp, dae$ feb  8 17:33:26 casparwylie sendmail[2606]: u18hxqoo002606: to="casparwylie@googlemail.com" <casparwylie@googlemail.com>, ctladdr=billing@buzzzap.com (33/33), delay=00:00:00, xdelay=00:0$ feb  8 17:33:26 casparwylie sm-mta[2609]: starttls=client, relay=gmail-smtp-in.l.google.com., version=tlsv1/sslv3, verify=fail, cipher=ecdhe-rsa-aes128-gcm-sha256, bits=128/128 feb  8 17:33:26 casparwylie sm-mta[2609]: u18hxqxe002607: to=<casparwylie@googlemail.com>, delay=00:00:00, xdelay=00:00:00, mailer=esmtp, pri=122393, relay=gmail-smtp-in.l.google.com. [7$ 

for each email try send.

however, quite not receive email when checking casparwylie@gmail.com.

would appreciate - i'm misunderstanding something!

while sending e-mails thru smtp located @ localhost don't have specify smtp related settings. try remove these lines:

$mail->issmtp(); $mail->smtpauth = false; $mail->issendmail(); $mail->host = "localhost"; $mail->port = 587; 

note: don't forget check spam folder


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -