doujiao7325 2019-02-15 10:53
浏览 245

无法连接到imap.gmail.com,即使提供正确的凭据和适当的设置

I configured gmail to get connected to imap.gmail.com in my web application. To do so I enable imap access and allowed to access the less secure app. But still I could not get connected to gmail imap.

first I tried -

imap_open('{imap.gmail.com:993/imap/ssl}INBOX','gmailaccount','password') 
        or die('Cannot connect to Webmail: ' . imap_last_error());

This gives error of Certificate failure for imap.gmail.com: unable to get local issuer certificate: /C=US/O=Google Trust Services/CN=Google Internet Authority G3 and I tried with novalidate-cert option which comes with vulnerability. And the code is -

imap_open('{imap.gmail.com:993/imap/ssl/novalidate-cert}INBOX','gmailaccount','password') 
        or die('Cannot connect to Webmail: ' . imap_last_error());

This gives error - Can not authenticate to IMAP server: [AUTHENTICATIONFAILED] Invalid credentials (Failure) even username and password are correct.

Actually, I want to connect with providing certificate. I googled - "How to issue certificate for GMAIL IMAP connection", but nothing useful there. What's wrong with this code while it's perfectly working with other web account. What should I do make it workable.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥100 set_link_state
    • ¥15 虚幻5 UE美术毛发渲染
    • ¥15 CVRP 图论 物流运输优化
    • ¥15 Tableau online 嵌入ppt失败
    • ¥100 支付宝网页转账系统不识别账号
    • ¥15 基于单片机的靶位控制系统
    • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
    • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
    • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
    • ¥15 手机接入宽带网线,如何释放宽带全部速度