fgtsai0418 Posted July 13, 2013 Share Posted July 13, 2013 Now I can do is it connect to Gmail but I don't know how to fetch a message only for "@123mobile.com" this domain name. ***************************** <?php $authhost="{pop.gmail.com:995/pop3/ssl/novalidate-cert}"; $user="username@gmail.com"; $user="name@gmail.com"; $pass="pwd"; if ($mbox=imap_open( $authhost, $user, $pass )) { echo "<h1>Connected</h1>n"; $check = imap_mailboxmsginfo($mbox); echo "Date: " . $check->Date . "<br />n" ; echo "Driver: " . $check->Driver . "<br />n" ; echo "Unread: " . $check->Unread . "<br />n" ; echo "Size: " . $check->Size . "<br />n" ; imap_close($mbox); } else { echo "<h1>FAIL!</h1>n"; } ?> Link to comment Share on other sites More sharing options...
justsomeguy Posted July 15, 2013 Share Posted July 15, 2013 I use imap_check instead of imap_mailboxmsginfo to get information about the mailbox, including the number of messages, and then loop through and use functions like imap_headerinfo and imap_body to get information about each individual message. You can get the from header and check it for whatever you want. http://www.php.net/manual/en/function.imap-headerinfo.php Link to comment Share on other sites More sharing options...
fgtsai0418 Posted July 16, 2013 Author Share Posted July 16, 2013 So...Use imap_check, imap_headerinfo, imap_body will get message body?? How to get all mail ? not only unread mail ? Link to comment Share on other sites More sharing options...
justsomeguy Posted July 16, 2013 Share Posted July 16, 2013 That will get all mail. Link to comment Share on other sites More sharing options...
fgtsai0418 Posted August 2, 2013 Author Share Posted August 2, 2013 case close Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now