-1

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:xxx@smtp.ionos.fr:465?encryption=ssl&auth_mode=login

#MAILER_DSN=sendgrid://KEY@default

yvon
  • 81
  • 1
  • 8
  • Remove the `#` , that's a comment, so your configuration isn't being read. And both `auth_mode` and `encryption` were [removed in 4.4](https://github.com/symfony/mailer/blob/e129f1500ffa25ef8e2dfe039bb075dc02979840/CHANGELOG.md). – msg Oct 20 '20 at 20:35
  • I have tried this. MAILER_DSN=smtp://contact@xxx.com:xxxx@smtp.ionos.fr:456 It's not working also. – yvon Oct 20 '20 at 21:23
  • The [documentation](https://symfony.com/doc/4.4/mailer.html#using-a-3rd-party-transport) states: "If your credentials contain special characters, you must URL-encode them". `@` is a special character. – msg Oct 20 '20 at 21:54
  • I think the problem is not my config because when I comment out # MAILER_DSN =. I have the same error. maybe it's a problem with my myionos server. – yvon Oct 21 '20 at 07:47
  • I had this issue and it was caused by me not committing ./config/packages/mailer.yaml – Ste Aug 18 '23 at 14:31

2 Answers2

3

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".

yvon
  • 81
  • 1
  • 8
0

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'
nacholibre
  • 3,874
  • 3
  • 32
  • 35