GET MAILBOXES

<?php
$hostname = ‘{imap.googlemail.com:993/imap/ssl/novalidate-cert}INBOX’;
$username=”sofathitesh@gmail.com”;
$password=”admin@rockxx”;
$con=imap_open($hostname,$username,$password);
$list=imap_getmailboxes($con,”{imap.googlemail.com:993/imap/ssl/novalidate-cert}”,”*”);
//print_r($list);
foreach($list as $key=>$val){
echo $val->name;
}
/*if(is_array($list)){
foreach($list as $key=>$val){
echo “($key) “;
echo imap_utf7_decode($val->name) . “,”;
echo “‘” . $val->delimiter . “‘,”;
echo $val->attributes . “<br />\n”;
}
}*/
?>

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s