boa tarde
tenho codigo abaixo que enviava email normal.
agora a empresa trocou o smtp para o smtp.office365.com e dá erro ao enviar.
$mail_smtp_server = ‘smtp.office365.com’; // SMTP server name or IP address
$mail_smtp_user = ‘email@teste.com.br’; // SMTP user name
$mail_smtp_pass = ‘XXXXXX’; // SMTP password
$mail_from = ‘teste@teste.com.br’; // From email
$mail_to = $email_cliente; // To email
$mail_subject = ’ Fique atento com autenticidade dos seus boletos !’; // Message subject
$mail_message = $corpo_email; // Message body
$mail_format = ‘T’; // Message format: (T)ext or (H)tml
$mail_copies = ‘’; // List of the emails that will recieve the message
$mail_tp_copies = ‘’; // Type copies: BCC (Hiden copies) or CCC (Regular copies)
$mail_port = ‘587’; // Server port
$mail_tp_connection = ‘T’; // Connection security (S) or (N)
sc_mail_send($mail_smtp_server,
$mail_smtp_user,
$mail_smtp_pass,
$mail_from,
$mail_to,
$mail_subject,
$mail_message,
$mail_format,
$mail_copies,
$mail_tp_copies,
$mail_port,
$mail_tp_connection
);
}
coloquei o T no tp_conection mas dá o erro abaixo ao tentar enviar
Fatal error: Uncaught Swift_TransportException: Unable to connect with TLS encryption in C:\Program Files (x86)\NetMake\v9-php73\wwwroot\scriptcase\prod\third\swift\classes\Swift\Transport\EsmtpTransport.php:315 Stack trace: #0 C:\Program Files (x86)\NetMake\v9-php73\wwwroot\scriptcase\prod\third\swift\classes\Swift\Transport\AbstractSmtpTransport.php(118): Swift_Transport_EsmtpTransport->_doHeloCommand() #1 C:\Program Files (x86)\NetMake\v9-php73\wwwroot\scriptcase\prod\third\swift\classes\Swift\Mailer.php(79): Swift_Transport_AbstractSmtpTransport->start() #2 C:\Program Files (x86)\NetMake\v9-php73\wwwroot\scriptcase\app\webcallisto\cns_email_alerta_upload\index.php(3919): Swift_Mailer->send(Object(Swift_Message), Array) #3 C:\Program Files (x86)\NetMake\v9-php73\wwwroot\scriptcase\app\webcallisto\cns_email_alerta_upload\index.php(3713): cns_email_alerta_upload_apl->m_envia_email(‘14251’) #4 C:\Program Files (x86)\NetMake\v9-php73\wwwroot\scriptcase\app\webcallisto\cns_email_alerta_upload\index.php(2989): cns_email_aler in C:\Program Files (x86)\NetMake\v9-php73\wwwroot\scriptcase\prod\third\swift\classes\Swift\Transport\EsmtpTransport.php on line 315
obrigado.
Evaldo