Skip to content

Commit 265e136

Browse files
committed
Update SendEmail.pas
1 parent e6e58c5 commit 265e136

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/SendEmail.pas

+7-2
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,10 @@ function TSendEmail.Connect: TSendEmail;
532532
begin
533533
LLastResult := Format('Last Result: %s', [FIdSMTP.LastCmdResult.FormattedReply.Text]);
534534

535-
if LLastResult.ToUpper.Contains('AUTHENTICATION SUCCEEDED') or LLastResult.Contains('250 OK') then
535+
if
536+
LLastResult.ToUpper.Contains('AUTHENTICATION SUCCEEDED') or
537+
LLastResult.Contains('250 OK')
538+
then
536539
begin
537540
Log(LLastResult, True);
538541

@@ -603,7 +606,8 @@ function TSendEmail.Send(const ADisconnectAfterSending: Boolean = True): TSendEm
603606

604607
if
605608
E.Message.ToUpper.Contains('CLOSING CONNECTION') or
606-
E.Message.ToUpper.Contains('TOO MANY MESSAGES')
609+
E.Message.ToUpper.Contains('TOO MANY MESSAGES') or
610+
E.Message.ToUpper.Contains('CONNECTION CLOSED')
607611
then
608612
begin
609613
if FSendCountReconnect < FSendMaxReconnection then
@@ -758,6 +762,7 @@ procedure TSendEmail.Reconnect(AResend: Boolean = False);
758762

759763
Disconnect;
760764
Connect;
765+
761766
if AResend then
762767
Send;
763768
end;

0 commit comments

Comments
 (0)