Here you go, nerds. PHP 5.0 has IMAP built in. First, make sure you have it on your server. Also enable SMTP / IMAP in your Gmail account. Then upload some code like this in a php file:
<?php
@include_once("pwds.php") ;$imapaddress = “{imap.gmail.com:993/imap/ssl}”;
$imapmainbox = “[Gmail]/All Mail”;
$maxmessagecount = 10;
$imapaddressandbox = $imapaddress . $imapmainbox;$connection = imap_open ($imapaddressandbox, $user, $pass);
$numMSGs = imap_num_msg($connection);
echo (imap_body($connection, $numMSGs));
imap_close($connection);
?>
Also, make sure you have a separate (and admin-only permissions) file, with your password info – called pwds.php in this case:
<?php
$user = 'put your email address here';
$pass = 'put your password here';
$host = 'imap.gmail.com';
$port = "993";
?>
