邮件发送问题_诚请高手指点 >>500 error 这能表示成功吗? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 $All = "From:".$this->from."\r\n"; $All .= "To:".$this->to."\r\n"; $All .= "Subject:title\r\n"; $All .= "test"; 已经修改成$All = "From:".$this->from."\r\n"; $All .= "To:".$this->to."\r\n"; $All .= "Subject:".$this->subject."\r\n"; $All .= $this->body;但收到的邮件内容还是空白.信息:>>Success>>Success>>220 163.com Coremail SMTP(Anti Spam) System >>EHLO HELO >>250-mail 250-PIPELINING 250-AUTH LOGIN PLAIN NTLM 250-AUTH=LOGIN PLAIN NTLM 250 8BITMIME >>AUTH LOGIN >>334 dXNlcm5hbWU6 >>bGgtMjA0Ng== >>334 UGFzc3dvcmQ6 >>bGg4MjEwMTY= >>235 Authentication successful >>MAIL FROM: >>250 Mail OK >>RCPT TO: >>500 error >>DATA >> >>From: To: Subject:fdsa fdsafdsdsfa . >>354 End data with . >>QUIT >>500 error 多谢大家热心帮助,但还是没解决问题完全代码如下,大家帮我改改---------------------------------<?phpset_time_limit(120); class smtp_mail { var $host; var $port; var $user; var $pass; var $debug = false; var $conn; var $result_str; var $in; var $from; var $to; var $subject; var $body; function smtp_mail($host,$port,$user,$pass,$debug=false) { $this->host = $host; $this->port = $port; $this->user = base64_encode($user); $this->pass = base64_encode($pass); $this->debug = $debug;$this->socket = socket_create (AF_INET,SOCK_STREAM,SOL_TCP); if($this->socket) { $this->result_str = ">>".socket_strerror(socket_last_error()); $this->debug_show($this->result_str); } else { exit(">>"); } $this->conn = socket_connect($this->socket,$this->host,$this->port); if($this->conn) { $this->result_str = ">>".socket_strerror(socket_last_error()); $this->debug_show($this->result_str); } else { exit(">>"); } $this->result_str = ">><font color=#cc0000>".socket_read ($this->socket,1024)."</font>"; $this->debug_show($this->result_str);} function debug_show($str) { if($this->debug) { echo $str."<p>\r\n"; } } function send($from,$to,$subject,$body) { if($from == "" || $to == "") { exit(">>"); } if($subject == "") $sebject = "no"; if($body == "") $body = "no"; $this->from = $from; $this->to = $to; $this->subject = $subject; $this->body = $body; $All = "From:".$this->from."\r\n"; $All .= "To:".$this->to."\r\n"; $All .= "Subject:".$this->subject."\r\n"; $All .= $this->body; $this->in = "EHLO HELO\r\n"; $this->docommand(); $this->in = "AUTH LOGIN\r\n"; $this->docommand(); $this->in = $this->user."\r\n"; $this->docommand(); $this->in = $this->pass."\r\n"; $this->docommand(); $this->in = "MAIL FROM:".$this->from."\r\n"; $this->docommand(); $this->in = "RCPT TO:".$this->to."\r\n"; $this->docommand(); $this->in = "DATA\r\n"; $this->docommand(); $this->in = $All."\r\n.\r\n"; $this->docommand(); $this->in = "QUIT\r\n"; $this->docommand(); } function docommand() { socket_write ($this->socket, $this->in, strlen ($this->in)); $this->debug_show(">>".$this->in); $this->result_str = ">><font color=#cc0000>".socket_read ($this->socket, 1024)."</font>"; $this->debug_show($this->result_str); } } $smtp = new smtp_mail("smtp.163.com","25","aaa","bbbbbb",true);$smtp->send("<[email protected]>","<[email protected]>","title",".11111111."); ?> >>500 error 错误,肯定邮件打不开的。 简述Php中cURL的使用 求高手解答??? php中如何从文件中获取一个用户的相关信息 广州PHP程序员 一个简单POST的问题 谁帮我看下以下代码,为什么表格出不来呢? 另类重写URL后图片路径出现问题! 关于strstr()函数 我想上传文件并且解压缩,但是出错 WWW.51.NET的PHP 关于文件的包含 不知道是require 的问题还是服务器的问题!
$All .= "To:".$this->to."\r\n";
$All .= "Subject:title\r\n";
$All .= "test";
$All = "From:".$this->from."\r\n";
$All .= "To:".$this->to."\r\n";
$All .= "Subject:".$this->subject."\r\n";
$All .= $this->body;但收到的邮件内容还是空白.信息:
>>Success
>>Success>>220 163.com Coremail SMTP(Anti Spam) System >>EHLO HELO >>250-mail 250-PIPELINING 250-AUTH LOGIN PLAIN NTLM 250-AUTH=LOGIN PLAIN NTLM 250 8BITMIME >>AUTH LOGIN >>334 dXNlcm5hbWU6 >>bGgtMjA0Ng== >>334 UGFzc3dvcmQ6 >>bGg4MjEwMTY= >>235 Authentication successful >>MAIL FROM: >>250 Mail OK >>RCPT TO: >>500 error >>DATA >> >>From: To: Subject:fdsa fdsafdsdsfa . >>354 End data with . >>QUIT >>500 error
完全代码如下,大家帮我改改---------------------------------
<?php
set_time_limit(120);
class smtp_mail
{
var $host;
var $port;
var $user;
var $pass;
var $debug = false;
var $conn;
var $result_str;
var $in;
var $from;
var $to;
var $subject;
var $body; function smtp_mail($host,$port,$user,$pass,$debug=false)
{
$this->host = $host;
$this->port = $port;
$this->user = base64_encode($user);
$this->pass = base64_encode($pass);
$this->debug = $debug;
$this->socket = socket_create (AF_INET,SOCK_STREAM,SOL_TCP);
if($this->socket)
{
$this->result_str = ">>".socket_strerror(socket_last_error());
$this->debug_show($this->result_str);
}
else
{
exit(">>");
}
$this->conn = socket_connect($this->socket,$this->host,$this->port);
if($this->conn)
{
$this->result_str = ">>".socket_strerror(socket_last_error());
$this->debug_show($this->result_str);
}
else
{
exit(">>");
}
$this->result_str = ">><font color=#cc0000>".socket_read ($this->socket,1024)."</font>";
$this->debug_show($this->result_str);
}
function debug_show($str)
{
if($this->debug)
{
echo $str."<p>\r\n";
}
}
function send($from,$to,$subject,$body)
{
if($from == "" || $to == "")
{
exit(">>");
}
if($subject == "") $sebject = "no";
if($body == "") $body = "no";
$this->from = $from;
$this->to = $to;
$this->subject = $subject;
$this->body = $body; $All = "From:".$this->from."\r\n";
$All .= "To:".$this->to."\r\n";
$All .= "Subject:".$this->subject."\r\n";
$All .= $this->body;
$this->in = "EHLO HELO\r\n";
$this->docommand(); $this->in = "AUTH LOGIN\r\n";
$this->docommand(); $this->in = $this->user."\r\n";
$this->docommand(); $this->in = $this->pass."\r\n";
$this->docommand(); $this->in = "MAIL FROM:".$this->from."\r\n";
$this->docommand(); $this->in = "RCPT TO:".$this->to."\r\n";
$this->docommand(); $this->in = "DATA\r\n";
$this->docommand(); $this->in = $All."\r\n.\r\n";
$this->docommand(); $this->in = "QUIT\r\n";
$this->docommand();
}
function docommand()
{
socket_write ($this->socket, $this->in, strlen ($this->in));
$this->debug_show(">>".$this->in);
$this->result_str = ">><font color=#cc0000>".socket_read ($this->socket, 1024)."</font>";
$this->debug_show($this->result_str);
}
}
$smtp = new smtp_mail("smtp.163.com","25","aaa","bbbbbb",true);
$smtp->send("<[email protected]>","<[email protected]>","title",".11111111.");
?>