DELPHI7 用idsmtp 做一个简单邮件发送出问题了, 求解
我做过了个简单的发送邮件,下面是代码:
procedure TForm1.Button1Click(Sender: TObject);
begin
IdSMTP1.AuthenticationType:=atlogin;//用atNone不认证也不行
IdSMTP1.Host:='smtp.qq.com';
self.IdSMTP1.Port:=25;
IdSMTP1.Username:='qq号';
IdSMTP1.Password:='密码';//密码保密
self.IdMessage1.Subject:='标题';
self.IdMessage1.Body.Text :='测试';
self.IdMessage1.From.Address:='QQ号@qq.com';
self.IdMessage1.ReceiptRecipient.Address:='QQ号@qq.com';
try
IdSMTP1.Connect;
self.IdSMTP1.Authenticate;
self.IdSMTP1.Send(IdMessage1);
showmessage('发送成功');
finally
IdSMTP1.Disconnect;
end;
end;
但是运行的时候老是出现这个错误:
---------------------------
Debugger Exception Notification
---------------------------
Project Project1.exe raised exception class EIdProtocolReplyError with message 'Error: need RCPT command
'. Process stopped. Use Step or Run to continue.
---------------------------
OK Help
---------------------------
不知道错在哪,我的QQ号开启了SMTP ,防火墙都关了,杀毒软件也关了,还是不行,求帮助啊~~~~~~~