INDY怎样突破SMTP服务认证??(急)(0分)

Q

qddmh

Unregistered / Unconfirmed
GUEST, unregistred user!
急问!
我通过INDY组件利用新浪的SMTP服务器发送邮件,
但是如果用内部IP茹192。168。0。111通过代理服务器发送成功。
但是如果用外部IP茹202。110。192。22则报错如下:
Socket error #10054 Connection reset by peer
why???????

 
各位大侠快来帮忙
代码如下:
if SmtpLogin <> '' then
begin
if SmtpLogin = 'atNone' then
SMTP.AuthenticationType := atNone;
if SmtpLogin = 'atLogin' then
SMTP.AuthenticationType := atLogin;
end
else
SMTP.AuthenticationType := atLogin;
SMTP.UserID := Trim(Uid); //qddmh@sina.com
SMTP.Password := Trim(Password);
SMTP.Host := Trim(Host);
SMTP.Port := strtoint(Port); //25
try
SMTP.Connect;
except
Showmessage('连接SMTP服务器失败!');
Exit;
end;
try
with IdMsgSend do
begin
body.Clear;
Body.Add('this is invoice Detail');//内容
From.Text := Trim(Uid);
// 加入收件人
Recipients.EMailAddresses :=Trim(Receiver);//收件人
TIdAttachment.Create(IdMsgSend.MessageParts, ExtractFilePath(Application.ExeName) + 'Temp/Temp.xls');
Subject:='Invoice detail'//主题
end;
SMTP.Send(IdMsgSend);
finally
SMTP.Disconnect;
end;
当执行到SMTP.Send(IdMsgSend)时报错: Socket Error #10054 Connection Reset by Peer.
此情况只在当本机IP用的外部IP(202.XXX.XXX.XXX)时发生,而通过代理服务器执行时发送成功
我想这种情况应该是已经通过了SMTP验证了,但为什么步成功呢?

帮忙, 美分了。
 
你看看IDSMTP的SocksInfo属性,可能对你有帮助哦
呵呵,自己看吧,我就不详述了
 
naughtboy老大, SockInfo属性我都是了, 需要smtp验证, 但我
以将AuthenticationType属性设为atLogin了
帮帮忙!!
 
大侠们, 帮帮忙~
 
为什么没有帮忙的呢?
 
IdMessage1.Recipients.EMailAddresses := who ;
IdMessage1.From.Address := UserEmail ;
IdMessage1.Sender.Address := UserEmail ;
TIdAttachment.Create(IdMessage1.MessageParts, PathFile);
Result := true;

try
Application.ProcessMessages ;
IdSMTP1.Send(IdMessage1);
except
Memo1.Lines.Add('error.');
Result := false;
SMTPDisConnection();
IdMessage1.MessageParts.Clear;
exit;
end;
 
rebirth:
我用你的代码错误依旧,
你通过你的代码是在外部ip还是通过代理服务器的内部ip?
 
qddmh 你好

解决了这个问题了吗? 能实现 支持 代理服务器和发邮件验证 ,请赐教!
谢谢 老兄 !
 


我也遇到同样的问题了,就是在网吧的机器上会碰到"Socket error #10054 Connection reset by peer
why???????"
 
接受答案了.
 
顶部