Sorry, openssl isn’t installed by default. It was a testing machine where I installed openssl manually some time ago…
So to test if it works from inside the container you could install openssl with following commands: (After restarting webserver, openssl isn’t installed anymore, it’s not persistent)
runagent -m webserver1 podman exec php7.4-fpm apt update
runagent -m webserver1 podman exec php7.4-fpm apt install openssl -y
Now following test should show if you can connect to the hosts mailserver:
EDIT:
I was able to send a mail with phpmailer by using 10.5.4.1 (wireguard IP) as mail server and adding the following to the script as recommended here.
$mail->SMTPOptions = array(
'ssl' => array(
'verify_peer' => false,
'verify_peer_name' => false,
'allow_self_signed' => true
)
);