Connect with Peer Bloggers

Get your Bloggers ID and network with best bloggers around the world.

6

Read and update your mailbox using php

Czetsuya
czetsuya's tech ― There are 2 ways I use 2 read email from my mailbox. Let the code explain:1.) Usually use for gmail./* connect to gmail */$hostname = '{imap.gmail.com:993/imap/ssl}INBOX';$username = 'xxx@gmail.com';$password = 'xxx';/* try to connect */$inbox = imap_open($hostname,$username,$password) or die('Cannot connect to Gmail: ' . imap_last_error());/* grab emails */$emails = imap_search($inbox,'ALL');/* if emails are returned, cycle through each... */echo "Messages count: " + count($emails);if($emails) [...]

Voted by 1 User



What would you say?

Be the first to comment on this blog post! Sign in or Create an account.