[英]Can't open mailbox: Invalid remote specification
I need to write a PHP script to get emails from our exchange server. 我需要编写一个PHP脚本来从我们的Exchange服务器获取电子邮件。 When trying to get them I'm getting this error: Can't open mailbox: invalid remote specification.
当试图获取它们时,我收到此错误:无法打开邮箱:无效的远程规范。 At the moment I'm using PHP 5.3.29
目前我正在使用PHP 5.3.29
I've already tried some URL parameter like 'ssl', 'notls' and 'novalidate-cert' for the imap_open() function. 我已经为imap_open()函数尝试了一些URL参数,如'ssl','notls'和'novalidate-cert'。
My PHP code: 我的PHP代码:
$request_body = json_decode(file_get_contents('php://input'));
$mailbox = $request_body->mailbox;
$username = $request_body->username;
$password = $request_body->password;
$imapResource = imap_open('{'.$mailbox.'}Inbox', $username, $password);
if($imapResource === false){
echo imap_last_error();
throw new Exception(imap_last_error());
}
My data: 我的数据:
{
"mailbox": "https://xxxx:32000",
"username": "xxxx@xx.de",
"password": "xxxxx"
}
Remove the "https://" from the "mailbox": " https://xxxx:32000 ". 从“邮箱”中删除“https://”:“ https:// xxxx:32000 ”。 Ensure that the port number is correct.
确保端口号正确。 Typically imap is 993 (SSL) or 143.
通常,imap是993(SSL)或143。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.