【发布时间】:2014-03-25 01:36:48
【问题描述】:
是否可以将PHP应用邮件与Office365集成?
我试过但发现这个错误:
authentication failure [SMTP: SMTP server does not support authentication (code: 250, response: SINPR02CA025.outlook.office365.com Hello [17*.***.***.**] SIZE 78643200 PIPELINING DSN ENHANCEDSTATUSCODES STARTTLS 8BITMIME BINARYMIME CHUNKING)]
到目前为止我的 PHP 代码:
$host = "smtp.office365.com";
$username = "me@company.com";
$password = "example";
$headers = array(
'From' => $from,
'To' => $to,
'Subject' => $subject,
'Content-Type' => 'text/html; charset=UTF-8'
);
$recipients = $to.", ".$bcc;
$smtp = Mail::factory('smtp',
array ('host' => $host,
'auth' => true,
'username' => $username,
'password' => $password));
$mail = $smtp->send($recipients, $headers, $body);
【问题讨论】:
-
尝试添加端口号或使用php mailer
-
我不认为正确的地址是
smtp.office365.com事实上,我最后一次这样做时我不得不联系微软,他们建议它是podxxxxx.outlook.com。 -
有例子吗?
标签: php