I know this question has already been answered a few different ways, but I will include mine to expand upon. One way would be to create an SSH Tunnel to the host computer, this is if you are having issues getting the mail client to connect directly just using ssmtp.
This is more of a hack around if everything you have tried keeps failing.
You can create a script that connects to the SSH tunnel running on port 25 by using sockets in whatever language you are coding in, this is if ssmtp is not working or there are certificate issues. But make sure your container and your machine running on port 25 are not exposed to remote connections. Because you are going to be using your local machine as a relay server. Meaning your script does not have to verify that it is a user on your host computer. The only remote connections you should allow is the docker0 connection and that is added to /etc/postfix/main.cf (see inet_interfaces solution above).
The script can be written fairly easily. Just lookup how to send mail using telnet to get an idea of the handshake protocol for smtp.
If port 25 is closed off to the public (it is recommended to keep this port close), use a ssh tunnel "ssh user@yourdomain.club -L 25:localhost:25" this is the same ssh tunnel you will be using to access port 25 inside your container. You will have to add open-ssh to your Dockerfile because most light weight versions of linux will not include ssh. You might be able to use net cat as well instead of open-ssh (ssh command), that may come some distros by default.
Also, be sure to add \r\n to each line in your script when you are connecting with sockets inside of your program. the \r stands for return and the \n stands for new line.
You are going to
1 create the tunnel
2 connect to the tunnel inside your script
3 send the mail commands from your script
4 disconnect from the tunnel
the tunnel will have to automatically open and reopen if it closes accidentally. Also, create an SSH key or use an expect -c bash script to enter in the password when creating the SSH tunnel. It is better in my opinion to have an SSH key added to the Docker container because expect -c scripts tend to have a slight delay waiting for the password prompt.