PHP IMAP和XOAUTH [英] PHP IMAP and XOAUTH
问题描述
我想使用XOAUTH和PHP访问gmail IMAP. http://code.google.com/intl/zh-CN/apis/gmail/oauth/protocol.html#imap
I want to access gmail IMAP using XOAUTH with PHP. http://code.google.com/intl/uk/apis/gmail/oauth/protocol.html#imap
我从上面的页面尝试了示例,我可以获取AUTHENTICATE XOAUTH的令牌.但是我不知道如何在IMAP请求中包含此令牌.我使用 http://php.net/manual/en/book.imap.php库以访问IMAP.似乎此PHP扩展不允许使用某些替代的AUTHENTICATE方法.可以在此IMAP扩展中使用XOAUTH吗?
I tried samples from page above and i can get get token for AUTHENTICATE XOAUTH . But i don't know how to include this token in IMAP requests. I use http://php.net/manual/en/book.imap.php library to access IMAP. Seems this PHP extension doesn't allow to use some alternate AUTHENTICATE methods. Is this possible to use XOAUTH with this IMAP extension?
如果没有,那我该怎么办?是否有可能为imap_open创建一些替代功能,该功能稍后会返回此句柄,并可以与此扩展的所有其他功能一起使用?
If no then what can i do there? Is it possible to create some alternate function for imap_open that will return some handle taht later can be used with all another functions of this extension?
推荐答案
许多人都会遇到这个问题.因此使用php_sockets实现了一个简单的库.希望将按要求行事.尚未添加删除邮件功能.但是您可以看看它是否满足您的需求.试试例子. https://github.com/vmuthal/VivOAuthIMAP
As a lot of people will hit this question. So Using php_sockets Implemented a simple library. Hopefully will act as required. Delete mail function is not yet added. But you can take a look if it satisfies your need. Try example. https://github.com/vmuthal/VivOAuthIMAP
这篇关于PHP IMAP和XOAUTH的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!