PHP
downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

Introduction> <cyrus_unbind
Last updated: Fri, 03 Jul 2009

view this page in

IMAP, POP3 and NNTP



add a note add a note User Contributed Notes
IMAP
alec
10-Sep-2008 02:08
The reason the above pop3 functions are not documented anywhere is that you are supposed to use the imap_* functions to deal with pop3 servers as well.

From the documentation for function imap_open():
-----
This function can also be used to open streams to POP3 and NNTP servers, but some functions and features are only available on IMAP servers.
-----

Not sure if this applies only to apt package users, but the pop3_* functions aren't included at all.

This is not clear from PHPs documentation unless you read the imap docs yourself, so its understandable if people miss it.

The PHP team really should take all the PHP functions, sit down and map them all out, and then rename them using one single naming convention. They could keep the old names as aliases for bc.
It really would help, but until & unless that happens, I will be more and mor drawn towards Python and its beautiful conventionally named classes and functions.
dickey at ascent dot co dot cc
25-Jun-2008 07:21
I noticed there are no documentations for the pop3 and smtp extensions...

anyway here is a list of pop3 commands and how I understand them:
I have tried those with * in the beginning:

pop3_undelete ($pop3_handle, $message_no)
  ->to issue RSET command. I don't know if the $message_no parameter should be there or not. I think RSET would reset all messages marked for deletion.

pop3_delete_message ($pop3_handle, $message_no)
  -> I assume it is to mark a message for deletion.

pop3_get_message ($pop3_handle, $message_no)
  -> I assume it is to issue a RETR command.

*pop3_get_message_size ($pop3_handle, $message_no)
  -> returns the size of the message. 

*pop3_get_message_header ($pop3_handle, $message_no)
  -> returns the message's headers.

pop3_get_message_sizes ($pop3_handle)
  -> Lists messages and their sizes.

pop3_get_message_ids ($pop3_handle, $message_no)
  -> Lists messages and their unique ids

*pop3_get_account_size($pop3_handle)
  -> Returns the size limit of the mail account?

*pop3_get_message_count($pop3_handle)
  -> Returns the number of messages from inbox.

*pop3_close($pop3_handle)
  -> Closes the pop3 connection.

*$pop3_handle = pop3_open($Server,$username,$password)
  -> Opens a connection to a pop3 server performs authentication and returns a handle to the pop3 connection.

Note: When you install your php you should include the pop3 extension.

Example:

$server = "tls://pop.gmail.com:995";
$username = "my_user_id@gmail.com";
$password = "mypassword";

$pop3 = pop3_open($server,$username,$password);
$message_header = pop3_get_message_header($pop3, 1);
print_r = $message_header;
pop3_close($pop3);

this code will print_r the message header of the first message. More work is needed to make the above code safe to execute.

Introduction> <cyrus_unbind
Last updated: Fri, 03 Jul 2009
 
 
show source | credits | stats | sitemap | contact | advertising | mirror sites