Liberalized return code handling.

git-svn-id: https://svn.code.sf.net/p/synalist/code/trunk@105 7c85be65-684b-0410-a082-b2ed4fbef004
This commit is contained in:
geby 2009-10-25 15:18:36 +00:00
parent 271b84aef0
commit b3133aee36

View File

@ -1,5 +1,5 @@
{==============================================================================| {==============================================================================|
| Project : Ararat Synapse | 003.004.003 | | Project : Ararat Synapse | 003.004.004 |
|==============================================================================| |==============================================================================|
| Content: SMTP client | | Content: SMTP client |
|==============================================================================| |==============================================================================|
@ -464,13 +464,13 @@ end;
function TSMTPSend.Reset: Boolean; function TSMTPSend.Reset: Boolean;
begin begin
FSock.SendString('RSET' + CRLF); FSock.SendString('RSET' + CRLF);
Result := ReadResult = 250; Result := ReadResult div 100 = 2;
end; end;
function TSMTPSend.NoOp: Boolean; function TSMTPSend.NoOp: Boolean;
begin begin
FSock.SendString('NOOP' + CRLF); FSock.SendString('NOOP' + CRLF);
Result := ReadResult = 250; Result := ReadResult div 100 = 2;
end; end;
function TSMTPSend.MailFrom(const Value: string; Size: Integer): Boolean; function TSMTPSend.MailFrom(const Value: string; Size: Integer): Boolean;
@ -481,13 +481,13 @@ begin
if FESMTPsize and (Size > 0) then if FESMTPsize and (Size > 0) then
s := s + ' SIZE=' + IntToStr(Size); s := s + ' SIZE=' + IntToStr(Size);
FSock.SendString(s + CRLF); FSock.SendString(s + CRLF);
Result := ReadResult = 250; Result := ReadResult div 100 = 2;
end; end;
function TSMTPSend.MailTo(const Value: string): Boolean; function TSMTPSend.MailTo(const Value: string): Boolean;
begin begin
FSock.SendString('RCPT TO:<' + Value + '>' + CRLF); FSock.SendString('RCPT TO:<' + Value + '>' + CRLF);
Result := ReadResult = 250; Result := ReadResult div 100 = 2;
end; end;
function TSMTPSend.MailData(const Value: TStrings): Boolean; function TSMTPSend.MailData(const Value: TStrings): Boolean;
@ -519,7 +519,7 @@ begin
if t <> '' then if t <> '' then
FSock.SendString(t); FSock.SendString(t);
FSock.SendString('.' + CRLF); FSock.SendString('.' + CRLF);
Result := ReadResult = 250; Result := ReadResult div 100 = 2;
end; end;
function TSMTPSend.Etrn(const Value: string): Boolean; function TSMTPSend.Etrn(const Value: string): Boolean;