retrieving email from IMAP server using PHP

the mail() function

Moderators: macek, egami, gesf

New php-forum User
New php-forum User
Posts: 4
Joined: Tue Oct 15, 2002 10:26 am
Location: Raleigh

retrieving email from IMAP server using PHP

Postby kunal_it » Thu Oct 31, 2002 12:41 pm

I want to retrieve mails from an IMAP server.

I am running my script on a machine different from where the IMAP server is running.

For doing this, I am making use of imap_open function that comes with php-imap package. Both php and php-imap packages have version 4.1.2 (release 7).

Now, when I am trying to open an IMAP stream to the mail server, I get a warning 'couldn't open stream'..

here is what i am exactly doing.

$inbox = imap_open("{}","username","password");

I also tried

$inbox = imap_open("{}INBOX","username","password");

and also tried specifying the port number 143 explicitly. However, none of them worked. Any ideas of why am I getting this error?


Oleg Butuzov
Last Samuray
Last Samuray
Posts: 831
Joined: Sun Jun 02, 2002 3:09 am

Postby Oleg Butuzov » Sun Nov 10, 2002 12:15 pm

Code: Select all

$str = "{".$host."/".$protocol.":".$port."}INBOX";
imap_open($str, "$user", "$password");

try this...

Return to “PHP coding => Mail”

Who is online

Users browsing this forum: No registered users and 1 guest