Connect to Gmail with PHP & IMAP

前端 未结 3 2130
轮回少年
轮回少年 2020-12-29 10:31

I have enabled OpenSSL and IMAP functions from my php.ini file and phpinfo() confirms it.

By using the code below

3条回答
  •  孤城傲影
    2020-12-29 11:08

    First check your date and time settings on your server are correct.

    Alternatively try:

    $connect_to = '{imap.gmail.com:993/imap/ssl/novalidate-cert}INBOX',
    

    This will stop it from trying to validate certificate.

    I will probably get downvotes from people telling me this is bad practice as this leaves you open to Man in the Middle attacks. Which is true.

提交回复
热议问题