我做过了个简单的发送邮件,下面是代码: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 ,防火墙都关了,杀毒软件也关了,还是不行,求帮助啊~~~~~~~
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 ,防火墙都关了,杀毒软件也关了,还是不行,求帮助啊~~~~~~~
解决方案 »
- delphi7+sql2000查询字符改错
- 关于select * from where ...and...and... 语句中,最多可以用多少and??
- dblookupcombobox下拉框不能显示是怎么回事?
- 怎样在数据库中选出字段内容有重复的记录?
- 如何在SQL语句里格式化一整型数据?
- Item cannot be found in the collection corresponding to the requested name or ordinal.
- 类似QQ面板、Outlook面板的控件,是我自己编写的。现在先贴出部分文档,在我整理完之后会发到网上希望大家给与支持。
- 求救高手怎么在报表里字体的显示实现有如word里那样!
- 关于树和树之间的复制问题,马上给分
- like的麻烦!!哎,帮帮忙!
- 只知道窗口句柄,如何设置owner?
- 跪求一个在delphi下的,windows api的udp的实例代码
google查查吧,现在很多邮箱都不让直接连
EHLO
AUTH LOGIN
MAILFROM 发件人
RCPT 收件人
DATA 邮件内容以上报错明显就是你没有填写收件人,收件人的属性应该是Recipients
EHLO
AUTH LOGIN
MAILFROM 发件人
RCPT 收件人
DATA 邮件内容以上报错明显就是你没有填写收件人,收件人的属性应该是Recipients
[/Quote
感谢楼上,问题解决了,但是在测试163的时候貌似还是不行,是不是要把idsmtp.pas中的(rect)给屏掉???
邮件发送协议有些是需要 STARTTLS的,有些么支持的验证方式不一样等等。。