`
hudeyong926
  • 浏览: 2016112 次
  • 来自: 武汉
社区版块
存档分类
最新评论

php接收邮件类

 
阅读更多

通过POP3/IMAP / NNTP连接到邮箱,使用PHP IMAP扩展 https://github.com/dannyhu926/php-imap

// 4. argument is the directory into which attachments are to be saved:
$mailbox = new PhpImap\Mailbox('{imap.gmail.com:993/imap/ssl}INBOX', 'some@gmail.com', '*********', __DIR__);

// Read all messaged into an array:
$mailsIds = $mailbox->searchMailbox('ALL');
if(!$mailsIds) {
	die('Mailbox is empty');
}

// Get the first message and save its attachment(s) to disk:
$mail = $mailbox->getMail($mailsIds[0]);

print_r($mail);
echo "\n\nAttachments:\n";
print_r($mail->getAttachments());

 

分享到:
评论
1 楼 hdnlove 2012-04-10  
你好,我想请教下 。我用receivemail  接收邮件 怎么获取数据时   每次加载非常慢呢?您有办法解决吗?

相关推荐

Global site tag (gtag.js) - Google Analytics