Я получаю следующее сообщение об ошибке, но все настройки верны. Нет проблем, но есть совет, если кто-то выполнил настройку smtp для 365 office.
коннекторы добавлены в центр администрирования и изменены max sp, как рекомендовано
authentication failure [
SMTP: Invalid response code received from server
(code: 535, response: 5.7.3 Authentication unsuccessful
[LO2P265CA0220.GBRP265.PROD.OUTLOOK.COM]
)
]
вот код:
<?php
require_once "Mail.php";
$from = '<info@domain.com>';
$to = '<dodmaon@domani.com>';
$subject = 'Insert subject here';
$body = "Hello world! this is the content of the email";
$headers = array(
'From' => $from,
'To' => $to,
'Subject' => $subject
);
$smtp = Mail::factory('smtp', array(
'host' => 'smtp.office365.com',
'SMTPSecure' => 'tls',
'port' => '587',
'StartTLS' => true,
'auth' => true,
'username' => 'info@domain.com',
'password' => '321password'
));
$mail = $smtp->send($to, $headers, $body);
if (PEAR::isError($mail)) {
echo '<p>'.$mail->getMessage().'</p>';
} else {
echo '<p>Message successfully sent!</p>';
}
?>