Send email for localhost using IMAP

<?php
$hostname = ‘{imap.googlemail.com:993/imap/ssl/novalidate-cert}INBOX’;
$username=”sofathitesh@gmail.com”;
$password=”admin@rockxx”;
$inbox=imap_open($hostname,$username,$password);
$check=imap_check($inbox);
echo “Msg Count Before”.$check->Nmsgs.”\n”;
imap_append($inbox,”{imap.googlemail.com:993/imap/ssl/novalidate-cert}INBOX.Drafts”,
“From:sofathitesh@gmail.com”.”To:sofathitesh@gmail.com”.”subject:hellollll”.”\r\n”.”ffggggggggg”
);
$check=imap_check($inbox);
echo “new message”.$check->Nmsgs.”\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