fputs($socket,"From:这放发件人姓名<$this->Username>\r\n");
            fputs($socket,"Subject:$this->Title\r\n");
            fputs($socket,"To:$this->Recipients\r\n");
            fputs($socket,"\r\n");
            fputs($socket,$this->Content."\r\n");
            fputs($socket,"."."\r\n");
            fputs($socket,"QUIT\r\n");
            $result=fgets($socket);
            //echo $result.'<br/>';
            fclose($socket);
大家好帮我看看代码,这上网查了N多资料,好像我写的没有错啊。为什么不显示发件人姓名呢。、
我用 [email protected] 向 [email protected] 发邮件的,发件人处显示 <> ,下面显示由 [email protected]代发。是不是smtp.qq.com 就是不让显示?

解决方案 »

  1.   

    我看RFC2822标准中的示例
    From: John Doe <[email protected]>
    这儿名字两边都有空格。而且
    Subject: 这儿也要有空格隔开会不会是这个原因
      

  2.   

    为什么不用phpmailer?我试过QQ邮箱可以的
      

  3.   

    写着玩,PHPMAILER可以,咱也应该可以啊。
      

  4.   

    $this->socketCmd("EHLO HELO".L_CRLF);
    $this->socketCmd("AUTH LOGIN".L_CRLF);
    $this->socketCmd($this->m_user.L_CRLF);
    $this->socketCmd($this->pwd.L_CRLF);
    $this->socketCmd("MAIL FROM:".$m_from.L_CRLF);
    $this->socketCmd("RCPT TO:<".trim($m_to).">".L_CRLF);
    $this->socketCmd("DATA".L_CRLF);
    $this->socketCmd($this->m_mail_body.L_CRLF);
    $this->socketCmd(".".L_CRLF);
    $this->socketCmd("quit".L_CRLF);以上仅供参考。