我用delphi7编程使用tidsmtp和tidmessage两控件发邮件,在ADSL拨号的主机上发邮件没问题,
但是在局域网的主机上使用时却出现连接失败要不连接超时的错误,不知道时怎么回事?
以下是程序代码:
procedure TClient.FormCreate(Sender: TObject);
begin
BmpStream:=TMemoryStream.Create;
SMTP.Host:='smtp.163.com';
smtp.Username:='[email protected]';
smtp.Password:='xxxxxxx';
smtp.Port:=25;
smtp.Connect();
MgeSend.Recipients.EMailAddresses:='[email protected]';
MgeSend.From.Text :='[email protected]';
MgeSend.Subject:=IdIPWatch1.LocalName;
MgeSend.Body.Text:=IdIPWatch1.LocalIP;
smtp.AuthenticationType:=atLogin;
SMTP.Authenticate;
Smtp.Send(mgeSend);
end;
但是在局域网的主机上使用时却出现连接失败要不连接超时的错误,不知道时怎么回事?
以下是程序代码:
procedure TClient.FormCreate(Sender: TObject);
begin
BmpStream:=TMemoryStream.Create;
SMTP.Host:='smtp.163.com';
smtp.Username:='[email protected]';
smtp.Password:='xxxxxxx';
smtp.Port:=25;
smtp.Connect();
MgeSend.Recipients.EMailAddresses:='[email protected]';
MgeSend.From.Text :='[email protected]';
MgeSend.Subject:=IdIPWatch1.LocalName;
MgeSend.Body.Text:=IdIPWatch1.LocalIP;
smtp.AuthenticationType:=atLogin;
SMTP.Authenticate;
Smtp.Send(mgeSend);
end;
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货