$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.163.com,那你的信箱也必须是163.com的,要不人家不让你发!!
//你用这个类的时候你修改成你自己的信箱就可以了
$smtp = new smtp_mail("smtp.163.com","25","你的163.com的帐号",&qu
| 对此文章发表了评论 |
