Skip to content
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 SMTP SSL error #1084

Closed
sanderbee opened this issue Jun 28, 2017 · 0 comments
Closed

PHPmailer SMTP SSL error #1084

sanderbee opened this issue Jun 28, 2017 · 0 comments

Comments

@sanderbee
Copy link

We use PHPMailer 5.2.21. Our server is configured to use the local SMTP. So, the general PHPMailer commando looks like this:

$mail = new PHPMailer();
$mail->From = '[email protected]';
$mail->Host = 'localhost';
$mail->IsSMTP();
...

Since PHP5.6, this doesn't work anymore, because the certificate does not match. We get the following error:

Warning: stream_socket_enable_crypto(): Peer certificate CN='*.thisvps.com' did not match expected CN='localhost' in /ho...PHPMailer_latest/class.smtp.php

(*.thisvps.com is a valid, not-selfsigned wildsign certificate that is installed for the SMTP server, before this certificate was installed, it doesn't work eighter (no certificate error).).

I can suppress this error using:

$this->smtpConnect([
   'ssl' => [
       'verify_peer' => false,
       'verify_peer_name' => false,
       'allow_self_signed' => true
   ]
]);

But, is that the correct way to go? I'm not a big fan of suppressing errors;). Or maybe there is an error in our configuration? Or why is the SMTP request to 'localhost' checked at all?

Version info: PHP 5.6.30, PHPMailer: 5.2.21

Any suggestion are welcome, thanks in advance!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant