如何使用 Perl 对 Gmail 进行身份验证?
我已经安装了这个 用于获取 Gmail 收件箱内的访问和控制的模块。然而,当我尝试通过一个小的 Perl 脚本进行连接并测试功能时,我收到此错误消息。
Error: Could not login with those credentials - could not find final URL
Additionally, HTTP error: 200 OK
这是 Gmail.pm 模块内构建的错误。
我可以 ping 相关网址 ( https://www.google.com/accounts/ServiceLoginBoxAuth ) 所以我觉得问题不在于找到 URL。此外,我知道凭据是正确的并且可以在该 URL 上使用,因为我已经手动尝试过它们。
我正在使用 这个 用于测试的脚本。我已在适当的地方提供了我的凭据。
I've also installed this module with the same type of error.
Any idea why I'm getting blocked?
I've installed this module to gain access and controls within a Gmail inbox. However, when I try to connect through a small Perl script and test the functionality, I get this error message.
Error: Could not login with those credentials - could not find final URL
Additionally, HTTP error: 200 OK
This is an error built within the Gmail.pm module.
I can ping the URL in question ( https://www.google.com/accounts/ServiceLoginBoxAuth ) so I feel that the trouble isn't finding the URL. Furthermore, I know the credentials are correct and work at that URL because I have tried them manually.
I'm using this script for testing. I have supplied my credentials in the appropriate places.
I've also installed this module with the same type of error.
Any idea why I'm getting blocked?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
使用 Mail::IMAPClient ,如下所示。要通过 Mail::IMAPClient 通过 SSL 身份验证,您应该安装来自 Net::SSLeay 的 IO::Socket::SSL。如果是这样,这就像一个魅力。
Use Mail::IMAPClient as shown below. To get pass SSL authentication through Mail::IMAPClient, you should have IO::Socket::SSL from Net::SSLeay installed. If so this works like a charm.
我正在使用 Mail::POP3Client 成功访问 Gmail 帐户(准确地说是 google apps 帐户)
I am successfully accessing a gmail account (google apps account to be precise) using Mail::POP3Client
如果您也无法通过普通的 POP3 或 IMAP 访问 gmail,那么您遇到的是配置问题,而不是编程问题。
我使用此处描述的配置详细信息从 gmail(实际上是 Google Apps,使用相同的界面)获取邮件:http://download.gna.org/hpr/fetchmail/FAQ/gmail-pop-howto.html
(此答案更适合 超级用户不过!)
If you cannot access gmail through normal POP3 or IMAP either, then you have a configuration problem rather than a programming problem.
I fetch my mail from gmail (actually Google Apps, which uses the same interface), using configuration details described here: http://download.gna.org/hpr/fetchmail/FAQ/gmail-pop-howto.html
(This answer is far more appropriate for Super User though!)
您可以尝试使用以下模块
You can tried with the following module
您也可以使用以下代码
You can use the following code also