小弟弟想做一个EMAIL发送程序。用了IdSMTP 和 IdMessage 两个组件运行时总是提示这个错误:工程Project.exe检测到错误类EidProtocolReplyError,错误信息:bad sequence of commands.
进程中止.使用单步或运行继续运行.----------------------------------------
这里是代码,麻烦各位同志帮小弟看看错在哪?我快要崩溃了。procedure Tform1.Button1Click(Sender: TObject);
begin
IdSMTP1.Username :='g-lz';//在SMTP.163.com服务器上的用户名
IdSMTP1.Password := '9568254';//在SMTP.163.com服务器上的密码
IdSMTP1.Host :='smtp.163.com';//SMTP.163.com服务器
IdSMTP1.Port :=25;//服务器端口
IdSMTP1.AuthenticationType := atLogin;
try
  IdSMTP1.Connect;//建立连接
  except
   Showmessage('连接SMTP服务器失败!');
   Exit;
   end;
try
  with IdMessage1 do
   begin
    body.Clear;
    Body.add('用户名及密码123');//邮件正文件内容,也可这样Body.Assign(memo1.lines);
    From.address :='daye1979';//发件人名
    Recipients.EMailAddresses :='[email protected]';//收件人邮箱
    Subject:='用户名及密码';//邮件标题
  end;
 IdSMTP1.Send(IdMessage1);//发送邮件
 finally
 showmessage('您的信件已成功发送') end;
end;
end.