programmatic access to gmail/google apps mailbox using zend framework php
// IMAP access must first be enabled on the account you want to check
function mail_googleapps()
{
try {
return new Zend_Mail_Storage_Imap(
array(
'ssl' => 'SSL',
'host' => 'imap.gmail.com',
'port' => '993',
'user' => '________@gmail.com', // or 'user.name@apps-domain.tld'
'password' => '########'
)
);
}
catch (Zend_Mail_Exception $ex) {
die($ex->getMessage() . " /me /die");
}
}