How can the smtp/pop3 client reads the [error] message that the smtp/pop3 server has send to them (in delphi)?

StackOverflow https://stackoverflow.com/questions/22959452

  •  30-06-2023
  •  | 
  •  

My server side smtp and pop3 events send [error] messages with ASender : TIdCommand like this :

ASender.Reply.SetReply(OK, 'message to send');

or

ASender.Reply.SetReply(ERR, 'error message to send');

So my question is how can this message be read from the smtp/pop3 client ?

有帮助吗?

解决方案

Sounds like you need to learn how exceptions work.

If Connect() fails, an exception is raised. Several different exception types are possible, including EIdSocketError, which contains the socket error code.

If a POP3/SMTP command fails, an EIdRFCReplyError exception is raised. The exception contains the server's response code and message. This information is also available in the component's LastCmdResult.Code, LastCmdResult.NumericCode, and LastCmdResult.Text properties.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top