Create mailbox with IMAP

<?php
$hostname = ‘{imap.googlemail.com:993/imap/ssl/novalidate-cert}INBOX’;
$username=”sofathitesh@gmail.com”;
$password=”admin@rockxx”;
$con=imap_open($hostname,$username,$password);
$name1=”rockx”;
$name2=imap_utf7_encode(“rockx”);
$newname=$name2;
imap_createmailbox($con,imap_utf7_encode(“{imap.googlemail.com:993/imap/ssl/novalidate-cert}INBOX.$newname”));
echo “ok”;
?>

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