Page 1 of 1

email client - getting email from the server

Posted: Thu Aug 05, 2010 4:22 pm
by nowandagain
Hi

I was just wondering if anyone could tell me what is wrong with this code. For a web application I want to connect to my email supplier with whom I have an account. I am trying to make a basic connection using imap, to simply test this is possible. I have looked around and have been unable to find sources that would help me, as I understand it, this particular method should be working.

Code: Select all

<?php
//Open an IMAP connection
$user = "##";
$password = "##";
$ms = imap_open("{mail.yahoo.com}INBOX", $user, $password);
$message = imap_num_msg($ms);
echo "<p> User $user has $message in his inbox.</p>";

?>

Re: email client - getting email from the server

Posted: Thu Aug 05, 2010 6:18 pm
by Weirdan
As far as I can tell, you can't use php's imap extension to connect to yahoo's imap servers because they use slightly different protocol (1 more command to send before login): http://en.wikipedia.org/wiki/Yahoo!_Mai ... TPs_access

Re: email client - getting email from the server

Posted: Fri Aug 06, 2010 9:13 am
by nowandagain
Thanks weirden for your reply.

Am I coming from the wrong angle, I am trying to create a PHP client to read email. I need it to be a working proto-type. Is IMAP the right solution. I was trying to connect to BTinternet.com as I already have an active account. I also have an MS outlook account at my University, would I still need to insert the GU ID = 1 statement for login.

Re: email client - getting email from the server

Posted: Fri Aug 06, 2010 9:28 am
by Weirdan
Most likely you won't need GUID command with any imap server other than Yahoo's.

Re: email client - getting email from the server

Posted: Fri Aug 06, 2010 9:33 am
by nowandagain
thanks