* 3. login($username,$password) - true = login successful, false = login error.
* 4. command_stat() - get number of messages
* 5. command_list() - get message ids, use command_uidl(), if you implement
* 3. login($username,$password) - true = login successful, false = login error.
* 4. command_stat() - get number of messages
* 5. command_list() - get message ids, use command_uidl(), if you implement
* 6. command_retr($some_message_id) - get message contents
* 7. command_dele($some_message_id) - mark message for deletion
* 8. command_quit() - close connection. You must close connection in order
* 6. command_retr($some_message_id) - get message contents
* 7. command_dele($some_message_id) - mark message for deletion
* 8. command_quit() - close connection. You must close connection in order
* 0 - plain text (default)
* 1 - tls (php 4.3 and openssl extension requirement)
* 2 - stls (stream_socket_enable_crypto() requirement. PHP 5.1.0, POP3
* 0 - plain text (default)
* 1 - tls (php 4.3 and openssl extension requirement)
* 2 - stls (stream_socket_enable_crypto() requirement. PHP 5.1.0, POP3
* Variable is used to store last positive POP server response
* checked in check_response() method. Used internally to handle
* mixed single and multiline command responses.
* Variable is used to store last positive POP server response
* checked in check_response() method. Used internally to handle
* mixed single and multiline command responses.
* @return mixed array with message ids (keys) and sizes (values) or boolean false
*/
function command_list($msg='') {
* @return mixed array with message ids (keys) and sizes (values) or boolean false
*/
function command_list($msg='') {
- fwrite($this->conn,"LIST $msg\r\n");
+ // add space between command and msg_id
+ if(!empty($msg)) $msg = ' ' . $msg;
+
+ fwrite($this->conn,"LIST$msg\r\n");
- fwrite($this->conn,"UIDL $msg\r\n");
+ //return $this->set_error('Unsupported command.');
+ // add space between command and msg_id
+ if(!empty($msg)) $msg = ' ' . $msg;
+ fwrite($this->conn,"UIDL$msg\r\n");
if($this->check_response()) {
$ids = array();
if (!empty($msg)) {
list($ok,$msg_id,$unique_id) = explode(' ',trim($this->response));
if($this->check_response()) {
$ids = array();
if (!empty($msg)) {
list($ok,$msg_id,$unique_id) = explode(' ',trim($this->response));
} else {
while($line = fgets($this->conn)) {
if (trim($line)=='.') {
break;
} else {
list($msg_id,$unique_id) = explode(' ',trim($line));
} else {
while($line = fgets($this->conn)) {
if (trim($line)=='.') {
break;
} else {
list($msg_id,$unique_id) = explode(' ',trim($line));
function command_stls() {
if (! function_exists('stream_socket_enable_crypto')) {
return $this->set_error('Used PHP version does not support functions required for POP STLS.',true);
function command_stls() {
if (! function_exists('stream_socket_enable_crypto')) {
return $this->set_error('Used PHP version does not support functions required for POP STLS.',true);
return $this->set_error('Selected POP3 server does not support STLS.',true);
}
fwrite($this->conn,"STLS\r\n");
if (! $this->check_response()) {
return $this->set_error('Selected POP3 server does not support STLS.',true);
}
fwrite($this->conn,"STLS\r\n");
if (! $this->check_response()) {