我在使用imap_open
打开广告的收件箱时遇到了一个大问题
组中的Office 365。
所有用户文件夹都列在imap_getmailboxes
中,但是
群组不会弹出!
该组已作为具有电子邮件的 SalaTeste1 创建 salateste1@example.onmicrosoft.com ,但是我无法使用 相同的用户密码。
我的代码如下:
<?php
error_reporting(E_ALL);
ini_set('display_errors', 1);
$hostname = '{outlook.office365.com:993/imap/ssl/novalidate-cert}';
$username = "exemplo@exemp.onmicrosoft.com";
$password = 'exemplo@2018';
$inbox = imap_open($hostname,$username,$password, null, 1,
array('DISABLE_AUTHENTICATOR' => array('GSSAPI', 'NTLM','PLAIN'))) or
die('Cannot connect to IMAP: ' . imap_last_error());
$list = imap_getmailboxes($inbox, "{$hostname}", "*");
if (is_array($list)) {
foreach ($list as $key => $val) {
echo "($key) ";
echo imap_utf7_decode($val->name) . ",";
echo "'" . $val->delimiter . "',";
echo $val->attributes . "<br />\n";
}
} else {
echo "imap_getmailboxes failed: " . imap_last_error() . "\n";
}
imap_close($inbox);
RESULT:
(0) {outlook.office365.com:993/imap/ssl/novalidate-
cert}Anota��es,'/',64
(1) {outlook.office365.com:993/imap/ssl/novalidate-cert}Arquivo
Morto,'/',64
(2) {outlook.office365.com:993/imap/ssl/novalidate-cert}INBOX,'/',68
(3) {outlook.office365.com:993/imap/ssl/novalidate-cert}Caixa de
Sa�da,'/',64
(4) {outlook.office365.com:993/imap/ssl/novalidate-
cert}Calend�rio,'/',32
(5) {outlook.office365.com:993/imap/ssl/novalidate-
cert}Calend�rio/Anivers�rios,'/',64
(6) {outlook.office365.com:993/imap/ssl/novalidate-
cert}Calend�rio/Feriados de Brasil,'/',64
(7) {outlook.office365.com:993/imap/ssl/novalidate-
cert}Contatos,'/',32
(8) {outlook.office365.com:993/imap/ssl/novalidate-cert}Hist�rico de
Conversa,'/',32
(9) {outlook.office365.com:993/imap/ssl/novalidate-cert}Itens
Enviados,'/',64
(10) {outlook.office365.com:993/imap/ssl/novalidate-cert}Itens
Exclu�dos,'/',32
(11) {outlook.office365.com:993/imap/ssl/novalidate-cert}Itens
Exclu�dos/salaTeste1,'/',64
(12) {outlook.office365.com:993/imap/ssl/novalidate-
cert}Journal,'/',64
(13) {outlook.office365.com:993/imap/ssl/novalidate-cert}Lixo
Eletr�nico,'/',64
(14) {outlook.office365.com:993/imap/ssl/novalidate-
cert}Rascunhos,'/',64
(15) {outlook.office365.com:993/imap/ssl/novalidate-
cert}Tarefas,'/',64
有人可以帮我吗?