关于smtp发邮件,谁能帮忙看看 503 Error: need EHLO and AUTH first

「已注销」 2010-07-06 10:06:30
Resolving SMTP server domain "smtp.qq.com"...
Connecting to host address "119.147.74.45" port 25...
Connected to SMTP server "smtp.qq.com".
S 220 esmtp4.qq.com Esmtp QQ Mail Server
C EHLO localhost
S 250-esmtp4.qq.com
S 250-PIPELINING
S 250-SIZE 52428800
S 250-AUTH LOGIN
S 250-AUTH=LOGIN
S 250 8BITMIME
C MAIL FROM:<839325966@qq.com>
C RCPT TO:<276190536@qq.com>
C DATA
S 503 Error: need EHLO and AUTH first !
Disconnected.
Cound not send the message to 276190536@qq.com. Error: 503 Error: need EHLO and AUTH first !
...全文
14106 10 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
此生,当如此 2012-05-21
  • 打赏
  • 举报
回复
我明明 登陆的 ,为什么 好几楼 的回复看不了,
blackskin 2012-01-14
  • 打赏
  • 举报
回复
"
退信原因 未知原因
host mydomain.com[211.154.*.*] said: 503 you must auth first (in reply to DATA command)
"
我用QQ邮箱给我自己的邮箱服务器(myname@mydomain.com)发的邮件被退回来了,请高人指点啊。
其中(myname@mydomain.com)是我自己搭建的邮件服务器,因为是新手,所以搞不懂什么原因,请高人指点。
blackskin 2012-01-14
  • 打赏
  • 举报
回复
"
退信原因: 未知退信原因
英文说明:SMTP error, DATA: 503 you must auth first.(SMTP error, DATA: 503 you must auth first)
"
我用126的邮箱给我自己的邮件服务器(myname@mydomain.com)发的邮件被退回来了,请高人指点啊。
有什么设置不对、
orz_ORZ_orz 2010-09-04
  • 打赏
  • 举报
回复
学习学习,看看
davy152486 2010-07-06
  • 打赏
  • 举报
回复
need EHLO and AUTH first !是由于多次登陆被理解恶意造成的
Dleno 2010-07-06
  • 打赏
  • 举报
回复
need EHLO and AUTH first !

这个不是说得很清楚了吗?
要先打招呼握手,并请求登陆。


if(!$fp=fsockopen($this->smtp['host'],$this->smtp['port'],$errno,$errstr)){
$this->message[]="连接邮件服务器失败,请检查:\r\n1、服务器地址和端口是否设置正确!\r\n2、网络是否通畅!";
return false;
}
if(strncmp(fgets($fp,512),'220',3)!=0){
$this->message[]="连接邮件服务器失败,请检查:\r\n1、服务器地址和端口是否设置正确!\r\n2、网络是否通畅!";
return false;
}
if($this->smtp['auth']){
fwrite($fp,"EHLO ".$this->smtp['posthost']."\r\n");
while($rt=strtolower(fgets($fp,512))){
if(strpos($rt,"-")!==3 || empty($rt)){
break;
}elseif(strpos($rt,"2")!==0){
$this->message="与服务器招呼握手时错误";
return false;
}
}
fwrite($fp, "AUTH LOGIN\r\n");
if(strncmp(fgets($fp,512),'334',3)!=0){
$this->message="提示服务器要登陆验证时错误";
return false;
}

fwrite($fp, base64_encode($this->smtp['user'])."\r\n");
if(strncmp(fgets($fp,512),'334',3)!=0){
$this->message="SMTP AUTH LOGIN 验证 用户名 错误!";
return false;
}
fwrite($fp, base64_encode($this->smtp['pass'])."\r\n");
if(strncmp(fgets($fp,512),'235',3)!=0){
$this->message="SMTP AUTH LOGIN 验证 密码 错误!";
return false;
}
} else{
fwrite($fp, "HELO ".$this->smtp['posthost']."\r\n");
}
$from = $this->smtp['from'];
$from = preg_replace("/.*\<(.+?)\>.*/", "\\1", $from);
fwrite($fp, "MAIL FROM: <$from>\r\n");
if(strncmp(fgets($fp,512),'250',3)!=0){
$this->message="发信人地址错误!";
return false;
}
fwrite($fp, "RCPT TO: <$toemail>\r\n");
if(strncmp(fgets($fp,512),'250',3)!=0){
$this->message="收信人地址错误!";
return false;
}
fwrite($fp, "DATA\r\n");
if(strncmp(fgets($fp,512),'354',3)!=0){
$this->message="邮件数据发送失败!";
return false;
}
$msg = "Date: ".date("r")."\r\n";
$msg .= "Subject: $send_subject\r\n";
$msg .= "$additional\r\n";
$msg .= "$send_message\r\n.\r\n";
fwrite($fp, $msg);
$lastmessage = fgets($fp, 512);
if(substr($lastmessage, 0, 3) != 250){
$this->message="连接邮件服务器失败,请检查:\r\n1、服务器地址和端口是否设置正确!\r\n2、网络是否通畅!";
return false;
}
fwrite($fp, "QUIT\r\n");
fclose($fp);
return true;


这些步骤你漏了什么?
Abin-2008 2010-07-06
  • 打赏
  • 举报
回复
很可能是你的qq邮箱的设置错误..看看开通了pop3和smtp服务.
CunningBoy 2010-07-06
  • 打赏
  • 举报
回复
1) 检查你的QQ邮箱的POP/SMTP功能有没有打开?
2) 有可能你的程序多次登录,被QQ邮箱当作恶意登录给拒绝了,换其他邮箱发送试试看。
3) 贴出你的代码,要不然别人不知道怎么帮你检查
「已注销」 2010-07-06
  • 打赏
  • 举报
回复
Resolving POP3 authentication host "pop.qq.com"...
Connecting to host address "119.147.15.31" port 110...
S +OK QQMail POP3 Server v1.0 Service Ready(QQMail v2.0)
C USER 839325966@qq.com
S +OK
C PASS xxxxxxxxxxxx
S +OK
Resolving SMTP server domain "smtp.qq.com"...
Connecting to host address "119.147.74.45" port 25...
Connected to SMTP server "smtp.qq.com".
S 220 esmtp2.qq.com Esmtp QQ Mail Server
C EHLO localhost
S 250-esmtp2.qq.com
S 250-PIPELINING
S 250-SIZE 73400320
S 250-AUTH LOGIN
S 250-AUTH=LOGIN
S 250 8BITMIME
C MAIL FROM:<839325966@qq.com>
C RCPT TO:<276190536@qq.com>
C DATA
S 503 Error: need EHLO and AUTH first !
Disconnected.
Cound not send the message to 276190536@qq.com. Error: 503 Error: need EHLO and AUTH first !
CunningBoy 2010-07-06
  • 打赏
  • 举报
回复
发送邮件前需要登陆
你有没有发登陆信息给smtp.qq.com服务器?

21,893

社区成员

发帖
与我相关
我的任务
社区描述
从PHP安装配置,PHP入门,PHP基础到PHP应用
社区管理员
  • 基础编程社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧