Connection could not be established with host mailhog

1k Views Asked by At

I have this mail class that is used to send an email after a user is manually verified in the admin backend. I copied the credentials from mailtrap.io into my .env file to test the mail but I got this log when the email class was invoked.

Swift_TransportException Connection could not be established with host mailhog: stream_socket_client(): php_network_getaddresses: getaddrinfo failed: No such host is known.

Mailtrap credentials

MAIL_MAILER=smtp
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=secrete
MAIL_PASSWORD=secrete
MAIL_ENCRYPTION=tls
MAIL_FROM_NAME="${APP_NAME}"
0

There are 0 best solutions below