POP3常用命令码大全

POP3命令码
如下:
命令          参数       状态     描述
------------------------------------------
USER          username    认可     此命令与下面的pass命令若成功,将导致状态转换
PASS          password    认可     
APOP          Name,Digest 认可     Digest是MD5消息摘要
------------------------------------------
STAT          None        处理     请求服务器发回关于邮箱的统计资料,如邮件总数和总字节数
UIDL          [Msg#]      处理     返回邮件的唯一标识符,POP3会话的每个标识符都将是唯一的
LIST          [Msg#]      处理     返回邮件数量和每个邮件的大小
RETR          [Msg#]      处理     返回由参数标识的邮件的全部文本
DELE          [Msg#]      处理     服务器将由参数标识的邮件标记为删除,由quit命令执行
RSET          None        处理     服务器将重置所有标记为删除的邮件,用于撤消DELE命令
TOP           [Msg#]      处理     服务器将返回由参数标识的邮件前n行内容,n必须是正整数
NOOP          None        处理     服务器返回一个肯定的响应
------------------------------------------
QUIT          None        更新     

 

附一段PHP接收Email邮件
的代码。

$resHandler = @fsockopen( $strHost, $intPort, &$intErrorNum, &$strMessage, $initConnSecond );
if( $resHandler ){
    $strResponse = fgets( $resHandler, 4096 );    // 获取连接信息
    $bolUserRight = fputs( $resHandler, "USER ".$strEmail."\r\n" );
    $bolPassRight = fputs( $resHandler, "PASS ".$strPasswd."\r\n" );
}

PHP数据库操作类 - ezSQL

ezSQL 下载地址://sjolzy.cn/php/ezSQL/bak/ez_sql_2.05.zip

新版本是2.05添加了很多支持,包括 CodeIgniter,MSSQL, PDO等等。

查看示例:

Example 1
----------------------------------------------------

// Select multiple records from the database and print them out..
$users = $db->get_results("SELECT name, email FROM users");
foreach ( $users as $user ) {
            // Access data using object syntax
            echo $user->name;
            echo $user->email;
}

Example 2
----------------------------------------------------

// Get one row from the database and print it out..
$user = $db->get_row("SELECT name,email FROM users WHERE id = 2");
echo $user->name;
echo $user->email;

Example 3
----------------------------------------------------

// Get one variable from the database and print it out..
$var = $db->get_var("SELECT count(*) FROM users");
echo $var;

Example 4
----------------------------------------------------

// Insert into the database
$db->query("INSERT INTO users (id, name, email) VALUES (NULL,'justin','jv@foo.com')");

Example 5
----------------------------------------------------

// Update the database
$db->query("UPDATE users SET name = 'Justin' WHERE id = 2)");

Example 6
----------------------------------------------------

// Display last query and all associated results
$db->debug();

Example 7
----------------------------------------------------

// Display the structure and contents of any result(s) .. or any variable
$results = $db->get_results("SELECT name, email FROM users");
$db->vardump($results);

Example 8
----------------------------------------------------

// Get 'one column' (based on column index) and print it out..
$names = $db->get_col("SELECT name,email FROM users",0)
foreach ( $names as $name ) {
    echo $name;
}

Example 9
----------------------------------------------------

// Same as above ‘but quicker’
foreach ( $db->get_col("SELECT name,email FROM users",0) as $name ) {
    echo $name;
}

Example 10
----------------------------------------------------

// Map out the full schema of any given database and print it out..
$db->select("my_database");
foreach ( $db->get_col("SHOW TABLES",0) as $table_name ) {
    $db->debug();
    $db->get_results("DESC $table_name");
}
$db->debug();