首页  >  问答  >  正文

php imap接收qq邮件的问题

写一个接收邮件的代码,提示无法连接,qq邮箱已开启imap,下面贴上代码,麻烦各位帮忙看看?

$host = '{imap.qq.com:993/imap/ssl}INBOX';
$user = '*****';
$pass = '*****';
$inbox = imap_open($host, $user, $pass)or die("can't connect: " . imap_last_error());   
$mailboxes = imap_list($inbox, $host, '*');
$mailboxes = str_replace($host, '', $mailboxes);
print_r($mailboxes);

贴上错误代码:从腾讯邮箱看到地址是imap.qq.com 提示报错。。
Warning: imap_open(): Couldn't open stream {imap.qq.com:993/imap/ssl}INBOX in D:phpStudyWWWimap.php on line 5
can't connect: Please using authorized code to login. More information at http://service.mail.qq.com/cg...
Notice: Unknown: Please using authorized code to login. More information at http://service.mail.qq.com/cg... (errflg=1) in Unknown on line 0

伊谢尔伦伊谢尔伦2722 天前921

全部回复(1)我来回复

  • 大家讲道理

    大家讲道理2017-05-24 11:33:20

    是不是没有用授权码登陆?

    回复
    0
  • 取消回复