Hi,
I’m trying to use sc_send_mail with MS 365 so I’ve these settings:
$smtp_server = ‘smtp.office365.com’;
$user = ‘xxxxx@xxxxxx.xxx’;
$pwd = ‘xxxxxx’;
$from = ‘xxxxx@xxxxxx.xxx’;
$to = ‘xxxxx@xxxxxx.xxx’;
$subject = ‘test’;
$message = ‘test’;
$msg_type = ‘H’;
$copy_recipients = ‘’;
$copy_type = ‘’;
$port = ‘587’;
$conn_type = ‘S’;
$attach = ‘’;
$ssl = ‘’;sc_mail_send($smtp_server, $user, $pwd, $from, $to, $subject, $message, $msg_type, $copy_recipients, $copy_type, $port, $conn_type, $attach, $ssl);
The result I get is this:
stream_socket_client(): SSL operation failed with code 1. OpenSSL Error messages:error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol
Changing to TSL:
$conn_type = ‘T’;
I get this error
Fatal error : Uncaught Swift_TransportException: Unable to connect with TLS encryption in /opt/NetMake/v9-php73/wwwroot/scriptcase/prod/third/swift/classes/Swift/Transport/EsmtpTransport.php:315 Stack trace: #0 /opt/NetMake/v9-php73/wwwroot/scriptcase/prod/third/swift/classes/Swift/Transport/AbstractSmtpTransport.php(118): Swift_Transport_EsmtpTransport->_doHeloCommand() #1 /opt/NetMake/v9-php73/wwwroot/scriptcase/prod/third/swift/classes/Swift/Mailer.php(79): Swift_Transport_AbstractSmtpTransport->start() #2 /opt/NetMake/v9-php73/wwwroot/scriptcase/app/procrm/control_test/control_test_apl.php(1810): Swift_Mailer->send(Object(Swift_Message), Array) #3 /opt/NetMake/v9-php73/wwwroot/scriptcase/app/procrm/control_test/control_test_apl.php(1054): control_test_apl->sc_btn_test_email() #4 /opt/NetMake/v9-php73/wwwroot/scriptcase/app/procrm/control_test/control_test_apl.php(1083): control_test_apl->ini_controle() #5 /opt/NetMake/v9-php73/wwwroot/scriptcase/app/procrm/control_test/index.php(1872): control_test_apl->controle() #6 { in /opt/NetMake/v9-php73/wwwroot/scriptcase/prod/third/swift/classes/Swift/Transport/EsmtpTransport.php on line 315
Is anyone successfully using sc_send_mail with MS 365 with secure authentication?
(I know it works with plain unsecure SMTP on port 25)