php - PHPMailer Error: Called Mail() without being connected -
i trying send mail service using phpmailer, works on localhost when utilize on byethost.com, free hosting website, says "phpmailer error: next address failed: vinceagno@gmail.com : called mail() without beingness connected"
i've tried changing address still same result.
here codes.
<?php require 'class.phpmailer.php'; $mail = new phpmailer(); $mail->issmtp(); $mail->mailer = 'smtp'; $mail->smtpauth = true; $mail->host = 'ssl://smtp.gmail.com'; // "ssl://smtp.gmail.com" didn't worked $mail->port = 465; $mail->smtpsecure = 'ssl'; // or seek these settings (worked on xampp , wamp): // $mail->port = 587; // $mail->smtpsecure = 'tls'; $mail->username = "xxxxxxxx@gmail.com"; $mail->password = "xxxxxxxx"; $mail->ishtml(true); // if going send html formatted emails $mail->singleto = true; // if want send same email multiple users. multiple emails sent one-by-one. $mail->from = "vinceagno@gmail.com"; $mail->fromname = "hotdog"; $mail->addaddress("vince_agno@live.com","user 1"); $mail->subject = "testing phpmailer localhost"; $mail->body = "hi,<br /><br />this scheme working perfectly."; if(!$mail->send()) echo "message not sent <br />phpmailer error: " . $mail->errorinfo; else echo "message has been sent"; ?>
thank in advance.
php email phpmailer
No comments:
Post a Comment