tomfmason Posted September 10, 2006 Share Posted September 10, 2006 I tired the following code. An example straight from the manual.[code]<?php$mailbox = imap_open("{mail.mydomain.net:110/pop3}", "username", "password");if (!$mailbox) { echo "Unable to connect to the mail server";}$overview = imap_fetch_overview($mailbox, "2,4:6", 0);if (is_array($overview)) { foreach ($overview as $val) { echo "$val->msgno - $val->date - $val->subject\n"; }imap_close($mailbox); ?>[/code]This returns nothing. I know that I have messages in this account. I am able to see the messages fine via Out Look express. I tried removing the foreach and just placed a print_r($overview); this returned an empty array.Any suggestions would great.Thanks,Tom Link to comment https://forums.phpfreaks.com/topic/20285-imap-help/ Share on other sites More sharing options...
onlyican Posted September 10, 2006 Share Posted September 10, 2006 You can see it in Outlook Express?Outlook Express downloads the mail from the mail server to your machine.So therefor the email will not be in the Mail Box on the server no more Link to comment https://forums.phpfreaks.com/topic/20285-imap-help/#findComment-89314 Share on other sites More sharing options...
tomfmason Posted September 10, 2006 Author Share Posted September 10, 2006 I knew that. I tried to use imap before I set up outlook express. When I look at my mail server log I see that I am loging in and I know that I have messages but they are just not displaying Link to comment https://forums.phpfreaks.com/topic/20285-imap-help/#findComment-89317 Share on other sites More sharing options...
onlyican Posted September 10, 2006 Share Posted September 10, 2006 You need to call the Mail boxHere is my function[code]<?phpfunction getImap() { global $servername; global $username; global $password; $mbox = imap_open("{".$servername.":110/pop3/notls}INBOX", $username, $password); return $mbox; }?> $mbox = getImap(); $mcheck = imap_check($mbox); $mnum = $mcheck->Nmsgs;$overview = imap_fetch_overview($mbox, "1:$mnum", 0);[code][/code][/code] Link to comment https://forums.phpfreaks.com/topic/20285-imap-help/#findComment-89324 Share on other sites More sharing options...
jefkin Posted September 11, 2006 Share Posted September 11, 2006 Slight typo, I think onlyican,[quote author=onlyican link=topic=107532.msg431588#msg431588 date=1157893699][code]<?phpfunction getImap() { global $servername; global $username; global $password; $mbox = imap_open("{".$servername.":110/pop3/notls}INBOX", $username, $password); return $mbox; } $mbox = getImap(); $mcheck = imap_check($mbox); $mnum = $mcheck->Nmsgs;$overview = imap_fetch_overview($mbox, "1:$mnum", 0);?>[/code][/quote] Link to comment https://forums.phpfreaks.com/topic/20285-imap-help/#findComment-89588 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.