You don't need to expose ports on the container for sending mail. However, because the container is most likely on an isolated network on the host system you need something to relay mail through. The top answer to the Stack Overflow question @GateOverflow linked to uses an MTA (Mail Transfer Agent, vulgo mail server) on the host for that purpose.
Since your Q2A instance seems to be configured for using local mail (checkbox "Send email via SMTP instead of local mail" under Admin ? Emails left unchecked, which is the default setting) you also need some kind of null mailer inside the container. The top answer to the Stack Overflow question uses SSMTP for that purpose, but other software can be used as well, for example nullmailer or even a full MTA like Postfix with a null client configuration.
The mail flow then goes from Q2A to the null mailer and from there to the host MTA, which will (attempt to) deliver the mail to the recipient's mail server(s).
Note that the host MTA may need to be set up to relay through another MTA if your hosting provider is blocking outbound connections to port 25 (many providers do this for spam prevention).
For further troubleshooting please check e-mail-related logs of both container and host. |