#Connection could not be established with host "mailpit:1025"

14 messages · Page 1 of 1 (latest)

sharp obsidian
#

im trying mailpit for first time:
im running mailpit in the terminal

mail.php

'mailers' => [
    'smtp' => [
        'transport' => 'smtp',
        'url' => env('MAIL_URL'),
        'host' => env('MAIL_HOST', 'smtp.mailgun.org'),
        'port' => env('MAIL_PORT', 587),
        'encryption' => env('MAIL_ENCRYPTION', 'tls'),
        'username' => env('MAIL_USERNAME'),
        'password' => env('MAIL_PASSWORD'),
        'timeout' => null,
        'local_domain' => env('MAIL_EHLO_DOMAIN'),
    ],

env

MAIL_MAILER=smtp
MAIL_HOST=mailpit
MAIL_PORT=1025
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
MAIL_FROM_ADDRESS="[email protected]"
MAIL_FROM_NAME="${APP_NAME}"

error when trying to send an email:

Connection could not be established with host "mailpit:1025": stream_socket_client(): php_network_getaddresses: getaddrinfo for mailpit failed: nodename nor servname provided, or not known

laravel v10

#

i cleared cahce

#

also restarted valet

#

idk what more to do

spice quest
#

Are you using sail?

sharp obsidian
#

nop

#

dont worry found it just now, omg

#

MAIL_HOST=mailpit

#

127.0.0.1 instead works

#

was that what u wanted to tell me?

spice quest
#

Yeah, the mail_host=mailpit works if you are serving both in the same docker network, like sail

#

Since docker is using the service name that declared in the docker compose file as the host

sharp obsidian
#

nice

#

thanks for ur time (: