Connection could not be established with host mailhog :stream_socket_client(): php_network_getaddresses: getaddrinfo failed:

  laravel, mailhog

I’m using laravel from docker container and i configured a mailhog server from other container (not in same docker-compose file)

this is my .env configuration

MAIL_DRIVER=smtp
MAIL_HOST=mailhog
MAIL_PORT=1025
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
[email protected]
MAIL_FROM_NAME="${APP_NAME}"

on horizon i got this error :
Swift_TransportException: Connection could not be established with host mailhog :stream_socket_client(): php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution in /var/www/html/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php:261

Any help please.
thank you

Source: Laravel

Leave a Reply