1
0
mirror of https://github.com/postfixadmin/postfixadmin.git synced 2025-07-31 10:04:20 +03:00

Send emails with TLS

This commit is contained in:
Felix Ableitner
2019-07-02 13:38:53 +02:00
parent 8b19ef21cf
commit 61ede42800

View File

@ -1398,6 +1398,13 @@ function smtp_mail($to, $from, $data, $password = "", $body = "") {
return false;
} else {
smtp_get_response($fh);
fputs($fh, "STARTTLS\r\n");
smtp_get_response($fh);
stream_set_blocking ($fh, true);
stream_socket_enable_crypto($fh, true, STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT);
stream_set_blocking ($fh, true);
fputs($fh, "EHLO $smtp_server\r\n");
smtp_get_response($fh);