下面是我用于imap提取电子邮件的代码。
$hostname = '{imap.secureserver.net:993/imap/ssl/}INBOX';
$username = 'xyz@domain.com';
$password = 'emailpassword';
$inbox = imap_open($hostname,$username,$password,NULL,1) or die('Cannot connect to Gmail: ' . print_r(imap_errors()));
以下是我得到的错误:
Array ( [0] => Can't open mailbox {imap.secureserver.net:993/imap/ssl/}INBOX: invalid remote specification ) Cannot connect to Gmail: 1