为什么?
但是我的网页要使用gb2312或者utf8编码

解决方案 »

  1.   

    不管你用的什么编码,总得指明你发送的编码,客户端好读取.
    加第四个参数,$header,并在里面指明你发送的编码.以下是手册的.// To send HTML mail, the Content-type header must be set
    $headers  = 'MIME-Version: 1.0' . "\r\n";
    $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";// Additional headers
    $headers .= 'To: Mary <[email protected]>, Kelly <[email protected]>' . "\r\n";
    $headers .= 'From: Birthday Reminder <[email protected]>' . "\r\n";
    $headers .= 'Cc: [email protected]' . "\r\n";
    $headers .= 'Bcc: [email protected]' . "\r\n";// Mail it
    mail($to, $subject, $message, $headers);
      

  2.   

    To楼上我加上了那些header都不行,使用了utf8,但是接收到的邮件还是乱码
      

  3.   

    使用class.phpmailer.php类,将里面的 var $CharSet = "uft-8"; 设置为这个