本人要实现在网站内通过输入用户名和密码接受SINA,SOHU的邮件和发送邮件的功能
 
现在接收成功了,但出现的全是乱码,还有用imap_appent发送邮件,提示错误.请高手指教.这是接受邮件的代码:<?php$mbox = imap_open("{pop.sina.com/pop3:110}", "user", "passwd");
if(imap_ping($mbox))
{
    echo "已连接<br>";
}
else
{
    echo "未连接<br>";
}   $mail_number =   imap_num_msg($mbox);//信件个数  
  echo "总共".$mail_number."封邮件!<br><br>";
  
  $pp=$_GET['page'];
  if($pp==""){
     $pp=1;
  }
  
  for($i=($pp-1)*10+1;$i<=($pp*10);$i++)   
  {   
  $mail_header=   imap_headerinfo($mbox,   $i);  
  $subject =   $mail_header->subject;//标题 
 
  if(stristr($subject,"=?jb2312"))
  {
   $subject = substr($subject,11);
$subject = substr($subject,0,-2);
$subject = imap_base64($subject);
  }   $from =   $mail_header->fromaddress;//发件人   
  $date =   $mail_header->date;//日期   
  echo "标题: <a   href=readmail.php?id=$i>$subject</a><br>";
  echo "来自: $from <br>";
  echo "日期: $date<br><br>";
}
?>
这是发邮件的代码:<?php
 
$mbox = imap_open("{pop.sina.com/pop3:110}", "jack8848515", "515515");
$tt = "[email protected]";$mes = "cc";$ss = imap_append($mbox,$tt,$mes);if(!$ss) {

echo "发送失败!".imap_last_error();}else {
 
echo "发送成功!";}?>