# SMTP error with PHP Mailer

**URL:** https://forum.infinityfree.com/t/smtp-error-with-php-mailer/34092
**Category:** Hosting Support
**Created:** [August 7, 2020, 10:45am UTC](https://forum.infinityfree.com/t/smtp-error-with-php-mailer/34092 "2020-08-07T10:45:08Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Pendo8](https://forum.infinityfree.com/letter_avatar/pendo8/32/5_5575768a8748004e209b776fc1b2916d.png) [@Pendo8](https://forum.infinityfree.com/u/Pendo8)
#### Post date: [August 7, 2020, 10:45am UTC](https://forum.infinityfree.com/t/smtp-error-with-php-mailer/34092/1 "2020-08-07T10:45:08Z")

</div>

[https://vegan-things.org](https://vegan-things.org)

(please specify the website or account you are asking about)

SMTP connect() Error

(please share the FULL error message you see)  
2020-08-07 10:40:58 SERVER → CLIENT: 220 2.0.0 SMTP server ready  
2020-08-07 10:40:58 Connection failed. Error #2: stream\_socket\_enable\_crypto(): SSL operation failed with code 1. OpenSSL Error messages:error:1416F086:SSL routines:tls\_process\_server\_certificate:certificate verify failed [/home/vol6\_5/epizy.com/epiz\_25602795/htdocs/PHPMailer/class.smtp.php line 374]  
SMTP Error: Could not connect to SMTP host.  
2020-08-07 10:40:58 CLIENT → SERVER: QUIT  
2020-08-07 10:40:58 SMTP → get\_lines(): $data is “”  
2020-08-07 10:40:58 SMTP → get\_lines(): $str is “”  
2020-08-07 10:40:58 SERVER → CLIENT:  
2020-08-07 10:40:58 SMTP ERROR: QUIT command failed:  
2020-08-07 10:40:58 Connection: closed

### Other Information

This had been previously working for months and suddenly this issue has reoccured. The smtp setting are correct and code has not changed.

$mail-\>Host = ‘[smtp.live.com](http://smtp.live.com)’; // Which SMTP server to use.  
$mail-\>Port = 587; // Which port to use, 587 is the default port for TLS security.  
$mail-\>SMTPSecure = ‘tls’; // Which security method to use. TLS is most secure.  
$mail-\>SMTPAuth = true; // Whether you need to login. This is almost always required.  
$mail-\>Username = “\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*_**"; // Your Gmail address.  
$mail-\>Password = "**_”; // Your Gmail login password or App Specific Password.

---

<div class="post-metadata">

### Author: ![XInterverse](https://forum.infinityfree.com/letter_avatar/xinterverse/32/5_5575768a8748004e209b776fc1b2916d.png) [@XInterverse](https://forum.infinityfree.com/u/XInterverse)
#### Post date: [August 7, 2020, 10:47am UTC](https://forum.infinityfree.com/t/smtp-error-with-php-mailer/34092/2 "2020-08-07T10:47:16Z")

</div>

Read here:

> [@PHPMailer Suddenly Stopped working](https://forum.infinityfree.com/t/phpmailer-suddenly-stopped-working/33986/4):
>
> We upgraded OpenSSL on our servers a few days ago. This may have resulted in SSL for SMTP breaking. I’m going to do some investigation into this. The provided SMTPOptions are a good workaround until then. Please note that you should AVOID such SMTPOptions as much as possible, because fixing SSL issues by disabling most SSL security features is NOT a good solution.

---

<div class="post-metadata">

### Author: ![anon5053279](https://forum.infinityfree.com/letter_avatar/anon5053279/32/5_5575768a8748004e209b776fc1b2916d.png) [@anon5053279](https://forum.infinityfree.com/u/anon5053279)
#### Post date: [August 8, 2020, 6:17pm UTC](https://forum.infinityfree.com/t/smtp-error-with-php-mailer/34092/3 "2020-08-08T18:17:48Z")

</div>

I also Get the Same issue…I have two external domain with 2 free hosting accounts.  
One the PHPmailer works fine. but other Domain hosting it gives me this error

2020-08-08 18:13:13 SERVER -\> CLIENT: 220 [perfora.net](http://perfora.net) (mreueus002) Nemesis ESMTP Service ready  
  
2020-08-08 18:13:13 CLIENT -\> SERVER: EHLO www.optiesaan.nl  
  
2020-08-08 18:13:13 SERVER -\> CLIENT: [250-perfora.net](http://250-perfora.net) Hello www.optiesaan.nl [185.27.134.183]250-8BITMIME250-AUTH LOGIN PLAIN250-SIZE 140000000250 STARTTLS  
  
2020-08-08 18:13:13 CLIENT -\> SERVER: STARTTLS  
  
2020-08-08 18:13:13 SERVER -\> CLIENT: 220 OK  
  
SMTP Error: Could not connect to SMTP host.  
  
2020-08-08 18:13:14 CLIENT -\> SERVER: QUIT  
  
2020-08-08 18:13:14   
  
2020-08-08 18:13:14   
  
SMTP connect() failed.  
There has been a mail error SMTP connect() failed.  
Can some one help me

---

<div class="post-metadata">

### Author: ![anon81626513](https://forum.infinityfree.com/letter_avatar/anon81626513/32/5_5575768a8748004e209b776fc1b2916d.png) [@anon81626513](https://forum.infinityfree.com/u/anon81626513)
#### Post date: [August 8, 2020, 6:53pm UTC](https://forum.infinityfree.com/t/smtp-error-with-php-mailer/34092/4 "2020-08-08T18:53:52Z")

</div>

I assume that is because you are using STARTTLS, using the OpenSSL system, Hence why it does not work, Technical.Legendz shared an article above

---

<div class="post-metadata">

### Author: ![system](https://infinityfree-forum-uploads.s3.dualstack.eu-central-1.amazonaws.com/original/3X/b/0/b024fd3fa88bae093c9576e55c2c94e33f890206.svg) [@system](https://forum.infinityfree.com/u/system)
#### Post date: [August 23, 2020, 7:08pm UTC](https://forum.infinityfree.com/t/smtp-error-with-php-mailer/34092/5 "2020-08-23T19:08:29Z")

</div>

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.
