Can't sent email with fresh docker installation

Hello,

I am a little bit lost, I am trying to migrate all my self hosted serviced to docker containers. I decided to use the nextcloud docker official image as a fresh start.

Well in my previous nextcloud instance (non dockerized) I was able to send email using smtp like a charm. I have trouble with the dockerized nextcloud, with exactly the same config

I run into this message:

A problem occurred while sending the email. Please revise your settings. (Error: Connection could not be established with host mail.gandi.net :stream_socket_client(): unable to connect to ssl://mail.gandi.net:465 (Connection timed out))

Is there something I missed to be able to send email using docker containers ?