PHP Classes

TLS with office365

Recommend this page to a friend!

      SMTP E-mail sending class  >  All threads  >  TLS with office365  >  (Un) Subscribe thread alerts  
Subject:TLS with office365
Summary:TLS not working on smtp office365.com
Messages:3
Author:Mannino Seb
Date:2022-10-12 16:08:38
 

  1. TLS with office365   Reply   Report abuse  
Picture of Mannino Seb Mannino Seb - 2022-10-12 16:08:38
Hello;
i'm using the smtp class for a while now with success but actually with php 7.4.7 on Linux i cannot connect properly the office365 smtp server.

I use TLS (start_tls = 1) without SSL and the call to the stream_socket_enable_crypto always fails.

I've tried with all the permitted constants with the same failing result.
STREAM_CRYPTO_METHOD_TLS_CLIENT fails.
The others too : STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT, STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT, STREAM_CRYPTO_METHOD_TLSv1_3_CLIENT.

Can anyone help me ?
Thanks
Regards
S. Man

  2. Re: TLS with office365   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2022-10-13 04:53:25 - In reply to message 1 from Mannino Seb
Hello Mannino,

Can you wait that I can take a look at that over the weekend?

  3. Re: TLS with office365   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2022-10-17 06:18:19 - In reply to message 1 from Mannino Seb
Hello Mannino,

I just tried using the class with Office 365 SMTP server.

It worked well.

What you need is to set the ssl variable to 0 when you set start_tls .

I have just added a new example script here below so you can try it your.


Can you please try this script and let me know if it works well for you too?

phpclasses.org/package/14-PHP-Sends ...