From 61ede4280006bfd96ea1bbdebcda96d66608f094 Mon Sep 17 00:00:00 2001 From: Felix Ableitner Date: Tue, 2 Jul 2019 13:38:53 +0200 Subject: [PATCH] Send emails with TLS --- functions.inc.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/functions.inc.php b/functions.inc.php index 3fbbee19..42d1d3e6 100644 --- a/functions.inc.php +++ b/functions.inc.php @@ -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);