你是要做一个WEB MAIL系统吧去http://www.igenus.org/看一下,会给你一些思路的。

解决方案 »

  1.   

    采用EXCHANGE建立邮箱服务器,协议用什么都可以POP3、IMAP、SMTP,功能可以作的非常强大,但作起来较为复杂了,你可以找点EXCHANGE的相关资料看看吧。
      

  2.   

    IMAP 的全名是 Internet Message Access Protocol,即网际网路讯息存取协定,为美国史丹福大学 (Stanford University) 在 1986 年开始研发的多重邮箱电子邮件系统。PHP 所提供的功能是 IMAP 4 的系统,这是根据 RFC 1730 所实作的。更多有关 IMAP 的资讯可以参考 IMAP 的官方网站 http://www.imap.org。 
    欲使用 IMAP 的电子邮件功能,要先到 ftp://ftp.cac.washington.edu/imap 下载 IMAP 的客户端程式。在编译完成之后将 c-client/c-client.a 复制到 /usr/local/lib 之中,并将 c-client/rfc822.h、mail.h 及 linkage.h 三个档案复制到 /usr/local/include 之下。之后编译 PHP 程式时要加入 --with-imap 的选项。 
     
    imap_append: 附加字串到指定的邮箱中。 
    imap_base64: 解 BASE64 编码。 
    imap_body: 读信的内文。 
    imap_check: 传回邮箱资讯。 
    imap_close: 关闭 IMAP 连结。 
    imap_createmailbox: 建立新的信箱。 
    imap_delete: 标记欲删除邮件。 
    imap_deletemailbox: 删除既有信箱。 
    imap_expunge: 删除已标记的邮件。 
    imap_fetchbody: 从信件内文取出指定区段。 
    imap_fetchstructure: 获取某信件的结构资讯。 
    imap_header: 获取某信件的标头资讯。 
    imap_headers: 获取全部信件的标头资讯。 
    imap_listmailbox: 获取邮箱列示。 
    imap_listsubscribed: 获取订阅邮箱列示。 
    imap_mail_copy: 复制指定信件到它处邮箱。 
    imap_mail_move: 移动指定信件到它处邮箱。 
    imap_num_msg: 取得信件数。 
    imap_num_recent: 取得新进信件数。 
    imap_open: 开启 IMAP 连结。 
    imap_ping: 检查 IMAP 是否连线。 
    imap_renamemailbox: 更改邮箱名字。 
    imap_reopen: 重开 IMAP 连结。 
    imap_subscribe: 订阅邮箱。 
    imap_undelete: 取消删除邮件标记。 
    imap_unsubscribe: 取消订阅邮箱。 
    imap_qprint: 将 qp 编码转成八位元。 
    imap_8bit: 将八位元转成 qp 编码。 
    imap_binary: 将八位元转成 base64 编码。 
    imap_scanmailbox: 寻找信件有无特定字串。 
    imap_mailboxmsginfo: 取得目前邮箱的资讯。 
    imap_rfc822_write_address: 电子邮件位址标准化。 
    imap_rfc822_parse_adrlist: 剖析电子邮件位址。 
    imap_setflag_full: 设定信件旗标。 
    imap_clearflag_full: 清除信件旗标。 
    imap_sort: 将信件标头排序。 
    imap_fetchheader: 取得原始标头。 
    imap_uid: 取得信件 UID。 
    imap_getmailboxes: 取得全部信件详细资讯。 
    imap_getsubscribed: 列出所有订阅邮箱。 
    imap_msgno: 列出 UID 的连续信件。 
    imap_search: 搜寻指定标准的信件。 
    imap_last_error: 最后的错误讯息。 
    imap_errors: 所有的错误讯息。 
    imap_alerts: 所有的警告讯息。 
    imap_status: 目前的状态资讯。
      

  3.   

    上面的内容在PHP文档里面我也看了
    有没有例子什么的?
    谢谢了
      

  4.   

    看你用什么平台实现了,如果是Linux的话,可以用:qmail + vpopmail + MySql + sqwebmail像sohu,etang,sina我想后台不是EXCHANGE。
      

  5.   

    要使用IMAP函数应该在php.ini里加一句:
    extension=php_imap.dll
    //-------------读某邮箱里是前十封邮件的标题、发件人--------
    //------- $server = 邮件服务器的IP----------
    $stream = imap_open("{$server}INBOX",$account,$password);
    $mail_number = imap_num_msg($stream);
    if(!$mail_number)die("没有信件");
    $sorted = imap_sort($stream, SORTDATE, 1, SE_UID);
    //--按照时间排序--
    echo "<br><table border=0 cellspacing=0 cellpadding=0 width=640 class=MList>";
    echo "<th bgcolor=C0C0C0 width=40>No.</th><th bgcolor=C0C0C0 width=220>标题</th>";
    echo "<th bgcolor=C0C0C0 width=220>发信人</th><th bgcolor=C0C0C0 width=40>附件</th>";
    echo "<th bgcolor=C0C0C0 width=80>日期</th><th bgcolor=C0C0C0 width=40>大小</th>";
    flush;
    for($n = ($page - 1) * 10; $n <= $page * 10 - 1; $n++)//前十封信...
    {
    $msgnum = $sorted[$n];//按日期排序后...
    if($n > $mail_number - 1)break;
    $i++; //本页 i 封信
    if($color=="ddeebb")$color = "ffffff";
    else $color = "ddeebb";
    // $mail_header = imap_headerinfo($stream,imap_msgno($stream, $msgnum));
    $mail_header = imap_headerinfo($stream, $msgnum); $subject = $mail_header->subject;
    if(stristr($subject, "=?gb2312?B?"))
    {  //-----汉字标题---
    $subject=substr($subject,11);
    // $subject=substr_replace($subject,'',-2);
    $subject=imap_base64($subject);
    }
    else if(stristr($subject,"=?iso-8859-1?Q?"))
    {  //---汉字标题---
    $subject=substr($subject,15);
    // $subject=substr_replace($subject,'',-2);
    $subject=imap_qprint($subject);
    }
    $from = $mail_header->fromaddress;
    $fromarray = $mail_header->from;
    if(stristr($from,"=?gb2312?B?"))
    {  //----汉字的From...
    $from = substr($from,11);
    $from_host = strstr($from,"<");
    // $from = substr($from,0,strpos($from,"?="));
    $from = imap_base64($from)." ".$from_host;
    }
    else if(stristr($from,"=?iso-8859-1?Q?"))
    {  //----汉字的From...
    $from = substr($from,15);
    // $from = substr_replace($from,'',-2);
    $from = imap_qprint($from);
    }
    if(!$subject)$subject="(none)";
    $from = htmlspecialchars($from);
    $date = $mail_header->date;
    $date = substr($date,5,11);
    $size = $mail_header->Size;
    $sum_size  = $sum_size + $size;
    if($size>1000)
    {
    $size = $size / 1000;
    $size = number_format($size,0);
    $theSize = $size."KB";
    }
    else $theSize = $size;
    $struct_msg = imap_fetchstructure($stream, $msgnum);
    if (isset($struct_msg->type) && $struct_msg->type == 1)
    {
    if ($struct_msg->subtype == 'ALTERNATIVE' || $struct_msg->subtype == 'RELATED')  //--附件--
    $attach = '';
    else
    $attach = '&nbsp; √';
    } if(is_array($fromarray))
    while(list(,$v)=each($fromarray))
    $from = "<a href=\"sendmail.php?to=".$v->mailbox."@".$v->host."\">".$from."</a>"; $theMsgNumber = $n + 1;
    echo "<tr><td bgcolor=$color><p align=right>$theMsgNumber<input type=checkbox name=msg[$i] value=$i></td>";
    echo "<td bgcolor=$color><a href=readmail.php?number=$msgnum&normalno=$n>$subject</a></td>";
    echo "<td bgcolor=$color>$from</td><td bgcolor=$color>$attach</td>";
    echo "<td bgcolor=$color>$date</td><td align=right bgcolor=$color>$theSize</td></tr>";
    }