If I use symfony/mailer in symfony4.4 on the my localhost with mailtrap, it works. No error

But If I try on the server https://my.ionos.fr, it display error like this :

Connection could not be established with host "ssl://null:465": stream_socket_client(): php_network_getaddresses: getaddrinfo failed: Name or service not known at /vendor/symfony/mailer/Transport/Smtp/Stream/SocketStream.php:138)"} []

Can anyone please help me? I have tried in .env but no one is working.

#MAILER_DSN=smtp://xxx:[email protected]:465?encryption=ssl&auth_mode=login

#MAILER_DSN=sendgrid://KEY@default

2

There are 2 answers

0
Yoan Arnaudov On BEST ANSWER

You need to check if you have any environment specific yaml configuration files, because they could not use ENV variables, but instead hardcoded ones.

For example you can have something like this in your config/packages/dev/mailer.yaml

framework:
    mailer:
        dsn: 'smtp://null'
0
yvon On

The origine of the problem is my config/mailer.yml This file is missing in the server that way i have this error "ssl://null:465".