I have just had a look at my docker-compose.yml file for my Joplin Server which has email activated. I cannot remember doing it (!) but in this post I mentioned that I added a port mapping for port 465 from the container to the host to get the mail to work.
ports:
- "22300:22300"
- "465:465"
Worth a try???