Replies: 7 comments 4 replies
-
Thanks for the information |
Beta Was this translation helpful? Give feedback.
-
I Agree this should be in the documentation (it is mentioned in the upgrade guide). But the best way to handle this, would be to add this to the default mail.php conf file so it would look like this: 'mailers' => [
'smtp' => [
'transport' => 'smtp',
'host' => env('MAIL_HOST', 'smtp.mailgun.org'),
'port' => env('MAIL_PORT', 587),
'encryption' => env('MAIL_ENCRYPTION', 'tls'),
'username' => env('MAIL_USERNAME'),
'password' => env('MAIL_PASSWORD'),
'timeout' => null,
'verify_peer' => env('MAIL_VERIFY_PEER', true),
], |
Beta Was this translation helpful? Give feedback.
-
Thank you for posting this. It solved my problems for the day! |
Beta Was this translation helpful? Give feedback.
-
Thank you, I've been searching solutions for this problem and nothing work, and finally found it here |
Beta Was this translation helpful? Give feedback.
-
Thank you group for the information. I added the line 'verify_peer => false' in config/mail.php and resolved! |
Beta Was this translation helpful? Give feedback.
-
Does it also solve my problem? I got this error first time on my production. |
Beta Was this translation helpful? Give feedback.
-
If it still does not work, a new parameter has been added for Symfony Mailer. See also auto_tls 'smtp' => [
'transport' => 'smtp',
'host' => env('MAIL_HOST', 'smtp.mailgun.org'),
'port' => env('MAIL_PORT', 587),
'encryption' => env('MAIL_ENCRYPTION', 'tls'),
'username' => env('MAIL_USERNAME'),
'password' => env('MAIL_PASSWORD'),
'timeout' => null,
'auth_mode' => null,
'verify_peer' => false,
'auto_tls' => false, // Important this line
] |
Beta Was this translation helpful? Give feedback.
-
hi there,
i recently upgraded to laravel 9 and because of the Symfony mailer I had problems sending emails, I never had before.
after debugging the Symfony mailer, I want to explain what's different and maybe someone who knows how to contribute
to the laravel docu is able to make a suggestion there because things in the "conf/mail.php" have changed, but the docu
does not mirror that, or at least I didn´t see that.
with laravel <=8, connecting a mail server via IP (not hostname) didn´t run into any problems, when it comes to checking the certificate, maybe because the cert never got verified I don´t know.
with laravel >=9, the cert gets verified (maybe by default) and with that, I ran into the error:
so first: the error is legit, no questions ask 😏
so in case you are not in control of the hostname or IP, you may be forced to disable that check.
because I didn´t know how to do this, google let me find something like this, but that only applies to laravel <=8:
but what I am missing in the latest documentation and in the upgrade guide is the information,
that with laravel 9 it now has to look like this:
and with "verify_peer" at this position, Symfony mailer now uses that option and disables any cert check.
i would be happy if someone could help to add this to the official documentation to avoid any further problems for other dev that have to deal with "disabling cert verification".
thanks!
Beta Was this translation helpful? Give feedback.
All reactions