domingo, 28 de marzo de 2021

Laravel 8 Mailhog in Homestead: connection could not be established with host mailhog

Laravel 8 Mailhog in Homestead: connection could not be established with host mailhog - Photo by Ivan Samkov from Pexels

After registering a user account in Laravel 8 Jetstream Homestead, I got the following error:

Connection could not be established with host mailhog :stream_socket_client(): php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution.

This error happened to me because in the .env file I had the following:

MAIL_MAILER=smtp
MAIL_HOST=mailhog
MAIL_PORT=1025
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
MAIL_FROM_ADDRESS=mail@net.com
MAIL_FROM_NAME="${APP_NAME}"

So, I set the MAIL_HOST value to "localhost":

MAIL_MAILER=smtp
MAIL_HOST=localhost
MAIL_PORT=1025
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
MAIL_FROM_ADDRESS=mail@net.com

And the problem got solved.

No hay comentarios.:

Publicar un comentario

Dockerize Moodle application

Create the docker - com pose . y ml file to deploy a Mood le application , using N ginx as a webs erver , latest PHP , and ...