Conversion tables A-K
  Conversion tables L-Z
  SPAM database query
  Reverse WHOIS utility
  North America area codes
  PHP Example forums

PHP example repository.

Back to examples
Purge / delete all emails from a POP server in PHP.

If you have a POP3 account which has been spammed to death, and being on dial-up you are unable to get in and delete all the messages, this handy script will delete all the messages on your POP server. There is no reason why this could not be modified to delete only messages over a certain size or even with some more modification to delete messages with specific content.

Note: There is no working example as the potential for misuse on this server makes it insecure.

// So, username is your POP3 $username, password is your $password

$cmd = array();
$cmd[]  = "USER $username\r\n";
$cmd[]  = "PASS $password\r\n";
$cmd[]  = "STAT\r\n";
$cmd[]  = "QUIT\r\n";

// Server is your POP3 server, ie
// Port is the port number ( should be 110 )

$port 110;

$fp  fsockopen($server$port);
"Error connecting to server $server");
$ret fgets($fp1024);
$cmd as $ret)
$line fgets($fp1024);
$fields explode(" ",$line);
$num_mails $fields[1];
fputs($fp,"DELE $i\r\n");
$line fgets($fp1024);