-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PHPMailer send email issues #1260
Comments
It looks like you have some duplicate rows in your __construct(). For example: $this->objMailer = new PHPMailer(true);
$this->objMailer->SMTPDebug = 2;
$this->objMailer->isSMTP();
$this->objMailer->Host = "smtp.gmail.com";
$this->objMailer->SMTPAuth = true; …all appears twice. Then the row:
…is a syntax error. I believe this might be some copy-paste problem. Anyway, please check |
You have a TLS problem. It's likely that your server is misconfigured (e.g. lacks openssl as @NiklasBr suggested, or has out of date CA certificates). Either way, you should read the troubleshooting guide that is linked from the error message as it tells you how to diagnose and deal with issues like this. |
great! |
I have an email class to send confirmation email after sign up
here is my construct function:
public function __construct() {
}
I implement the other methods fine, problem is it worked before when i made test on localhost now it returns this message:
2017-11-30 17:50:29 SERVER -> CLIENT: 220 smtp.gmail.com ESMTP m78sm953943vke.14 - gsmtp
2017-11-30 17:50:29 CLIENT -> SERVER: EHLO localhost
2017-11-30 17:50:29 SERVER -> CLIENT: 250-smtp.gmail.com at your service, [200.113.200.2]250-SIZE 35882577250-8BITMIME250-STARTTLS250-ENHANCEDSTATUSCODES250-PIPELINING250-CHUNKING250 SMTPUTF8
2017-11-30 17:50:29 CLIENT -> SERVER: STARTTLS
2017-11-30 17:50:30 SERVER -> CLIENT: 220 2.0.0 Ready to start TLS
SMTP Error: Could not connect to SMTP host.
2017-11-30 17:50:30 CLIENT -> SERVER: QUIT
2017-11-30 17:50:31
2017-11-30 17:50:31
SMTP Error: Could not connect to SMTP host.
Fatal error: Uncaught PHPMailer\PHPMailer\Exception: SMTP Error: Could not connect to SMTP host. in C:\xampp\htdocs\haitopp\classes\vendor\phpmailer\phpmailer\src\PHPMailer.php:1882 Stack trace: #0 C:\xampp\htdocs\haitopp\classes\vendor\phpmailer\phpmailer\src\PHPMailer.php(1709): PHPMailer\PHPMailer\PHPMailer->smtpConnect(Array) #1 C:\xampp\htdocs\haitopp\classes\vendor\phpmailer\phpmailer\src\PHPMailer.php(1465): PHPMailer\PHPMailer\PHPMailer->smtpSend('Date: Thu, 30 N...', 'This is a multi...') #2 C:\xampp\htdocs\haitopp\classes\vendor\phpmailer\phpmailer\src\PHPMailer.php(1307): PHPMailer\PHPMailer\PHPMailer->postSend() #3 C:\xampp\htdocs\haitopp\classes\Email.php(62): PHPMailer\PHPMailer\PHPMailer->send() #4 C:\xampp\htdocs\haitopp\classes\User.php(34): Email->process(1, Array) #5 C:\xampp\htdocs\haitopp\pages\signup.php(96): User->addUser(Array, 'F@ckemall0') #6 C:\xampp\htdocs\haitopp\classes\Core.php(7): require_once('C:\xampp\htdocs...') #7 C:\xampp\htdocs\haitopp\index.php(6): Core->run() #8 {main} thrown in C:\xampp\htdocs\haitopp\classes\vendor\phpmailer\phpmailer\src\PHPMailer.php on line 1882
I read the troubleshooting but I still stuck, please help me with your guidance.
The text was updated successfully, but these errors were encountered: