-1

我正在关注http://davidwalsh.name/gmail-php-imap以连接到 gmail 并下载一些电子邮件。我有:

$hostname = '{imap.gmail.com:993/imap/ssl}INBOX';
$username = 'davidwalshblog@gmail.com';
$password = 'davidwalsh';

/* try to connect */
$inbox = imap_open($hostname,$username,$password) or die('Cannot connect to Gmail: ' . imap_last_error());

/* grab emails */
$emails = imap_search($inbox,'ALL');

这似乎适用于收件箱,但是当我尝试使用发件箱时:

$hostname = '{imap.gmail.com:993/imap/ssl}SENT';

我得到:

Warning: include(application/errors/error_php.php): failed to open stream: No such file or directory 

有人可以告诉我如何连接到 gmail 发件箱吗?

4

1 回答 1

1

gmail 发件箱通常命名为“[Gmail]/Sent”。

于 2013-07-06T03:02:24.453 回答