My problem is different from this , because i am getting this error due to proxy network. I am using laravel 5.7 built-in email verification. i have configure it in the following way.
MAIL_DRIVER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
MAIL_USERNAME=mygmail@gmail.com
MAIL_PASSWORD=mypass
MAIL_ENCRYPTION=tls
This configuration works fine when i am connected to a non proxy network. when i change to a proxy network i am getting the following error
"Connection could not be established with host smtp.gmail.com [php_network_getaddresses: getaddrinfo failed: No such host is known. #0]"
How can i fix this issue for a proxy network? i know my configuration is okay for non proxy network.
You'll have to add something like this to your config/mail.php
return [
'components' => [
'mailer' => [
'transport' => [
'streamOptions' => [
'ssl' => [
'allow_self_signed' => true,
'verify_peer' => false,
'verify_peer_name' => false,
]
]
]
]
]
];