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
I was facing same problem. I am using windows and wamp and my wamp "openSSl" extension is enabled.
I removed this issue by using following steps.I hope this will work for you too.
1) Logged in via browser to gmail account.
2) Open this url "https://www.google.com/settings/security/lesssecureapps"
3) Click at "turn on"
4) try following code
subject.'
';
$output .= $headerInfo->toaddress.'
';
$output .= $headerInfo->date.'
';
$output .= $headerInfo->fromaddress.'
';
$output .= $headerInfo->reply_toaddress.'
';
$emailStructure = imap_fetchstructure($inbox,$mail);
//var_dump($emailStructure->parts);
if(isset($emailStructure->parts)) {
$output .= imap_body($inbox, $mail, FT_PEEK);
} else {
//
}
echo $output;
$output = '';
}
// colse the connection
imap_expunge($inbox);
imap_close($inbox);
?>
BEST OF LUCK. :)