I\'m trying to connect to Gmail through IMAP with PHP running in Apache. This is on an Ubuntu 9.04 system. I\'ve got some sort of PHP configuration issue that is keeping t
First, enable less secure apps in your Gmail account: https://myaccount.google.com/lesssecureapps
Use this configuration to create IMAP connection:
$imap_connection = imap_open('{imap.gmail.com:993/imap/ssl/novalidate-
cert}INBOX', 'YOUR GMAIL USER', 'YOUR GMAIL PASSWORD');
Note: INBOX is your main imbox, for example you can acces to sent items with: INBOX.Sent in your connection.