I want to test email using mail pit but could not get is to work.
I keep getting this error:
Connection could not be established with host "mailpit:1025": stream_socket_client(): php_network_getaddresses: getaddrinfo for mailpit failed: No such host is known.
I have mailpit running and can access the web interface.
This is my env setup.
@cybert22mailpit is set as the default to work with Laravel Sail, since Docker handles the resolution of the service. If you're not using Laravel Sail and Docker localhost must be used since your local machine cannot resolve the namespace.
@cybert22 localhost es el nombre de host predeterminado para su computadora. Si agrega más nombres de host como 'mailpit' a su C:\windows\system32\drivers\etc\hosts (agregue la línea 127.0.0.1 mailpit), ahora puede acceder a la interfaz de administración con, por ejemplo. http://mailpit:8025/.
For those who want to know why we use port 1025.
port 8025 is for the web interface and port 1025 is smtp port.
so this .env will work if you have docker instance of mailpit: