Home > Back-end >  How to solve the SMTP email error: socket error # 11002???????
How to solve the SMTP email error: socket error # 11002???????

Time:09-19

100 points to solve! Send to solve immediately!
1) a computer deployment in the outside network, there is a public static IP,
2) computer firewall is shut,
3) use to IdSMTP and IdMessage controls,
4) can ping ping gateway (205.227.95.31), but (205.227.95.32) ping ping IP impassability (gateways and IP is not true, the last digit is different, the first three),
5) send mail code is as follows:
Procedure TForm1. Button1Click (Sender: TObject);
The begin
Try
The begin
SQLStr:='XXXXXXX order by id asc';
ADOQuery2. Close;
ADOQuery2. SQL. The Clear;
ADOQuery2. SQL. The Add (SQLStr);
ADOQuery2. Open;
I:=ADOQuery2. RecordCount;
If I & gt; 0 then
The begin
Try
SMTP. Host:=Trim (Edit8. Text);
SMTP. Username:=Trim (Edit5. Text);
SMTP password:=Trim (Edit7. Text);
SMTP Port:=25;
MgeSend. Recipients. The Clear;
MgeSend. Recipients. The Add. Address:=ADOQuery2. FieldByName (' mail '). AsString;
If the Trim (EDT119. Text) & lt;> "' then
The begin
MgeSend. Recipients. The Add. Address:=Trim (EDT119. Text);
end;
MgeSend. From the Text:=Trim (Edit6. Text);
MgeSend. Subject:='hello world! ';
MgeSend. Body. Text:='hello world';
MgeSend. CharSet:="utf-8";
The finally
end;
Try
SMTP. The Connect ();
SMTP. Authenticate;
SMTP. Send (MgeSend);
The finally
SMTP. Disconnect;
end;
end;
end;
The finally
ADOQuery2. Close;
end;
end;
SQL IP connection with public IP, localhost, 127.0.0.1 have not tried, the same procedure on the Intranet can click for the send mail,
On the network on this computer, click next for the jump out "Socket Error # 11002", the mail can't send, how do I solve?
-----------

CodePudding user response:

IdSMTP1. Authenticate:=True;
IdSMTP1. AuthType:=satDefault;//satSASL?

CodePudding user response:

reference 1st floor linuxpingwangping response:
IdSMTP1. Authenticate:=True;
IdSMTP1. AuthType:=satDefault;//satSASL?


Not tried, or an error,
  • Related