我用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;