@@ -142,6 +142,7 @@ constructor TSendEmail.Create;
142
142
OnWork := Work;
143
143
OnWorkEnd := WorkEnd;
144
144
ManagedIOHandler := True;
145
+ PipeLine := False;
145
146
end ;
146
147
147
148
with FIdSSLOpenSSL do
@@ -570,7 +571,7 @@ function TSendEmail.Connect: TSendEmail;
570
571
except
571
572
on E: Exception do
572
573
begin
573
- Log(E.Message, True);
574
+ Log(' Except: ' + E.Message, True);
574
575
Log(' Email not connected!' );
575
576
raise;
576
577
end ;
@@ -598,9 +599,10 @@ function TSendEmail.Send(const ADisconnectAfterSending: Boolean = True): TSendEm
598
599
except
599
600
on E: Exception do
600
601
begin
601
- Log(E.Message, True);
602
+ Log(' Except: ' + E.Message, True);
602
603
603
- if E.Message.ToUpper.Contains(' CLOSING CONNECTION' ) or
604
+ if
605
+ E.Message.ToUpper.Contains(' CLOSING CONNECTION' ) or
604
606
E.Message.ToUpper.Contains(' TOO MANY MESSAGES' )
605
607
then
606
608
begin
@@ -621,6 +623,22 @@ function TSendEmail.Send(const ADisconnectAfterSending: Boolean = True): TSendEm
621
623
if E.Message.ToUpper.Contains(' NOT CONNECTED' ) then
622
624
raise Exception.Create(' Not connected to internet!' );
623
625
626
+ if
627
+ E.Message.ToUpper.Contains(' NO SUCH USER HERE' ) or
628
+ E.Message.ToUpper.Contains(' USER UNKNOWN' ) or
629
+ E.Message.ToUpper.Contains(' MAILBOX UNAVAILABLE' )
630
+ then
631
+ raise Exception.Create(' The recipient'' s mailbox does not exist in the destination domain. It was probably typed incorrectly!' );
632
+
633
+ if
634
+ E.Message.ToUpper.Contains(' MAILBOX IS FULL' ) or
635
+ E.Message.ToUpper.Contains(' MAIL QUOTA EXCEEDED' ) or
636
+ E.Message.ToUpper.Contains(' MAILBOX FULL' ) or
637
+ E.Message.ToUpper.Contains(' DISK QUOTA EXCEEDED' ) or
638
+ E.Message.ToUpper.Contains(' USER IS OVER THE QUOTA' )
639
+ then
640
+ raise Exception.Create(' It means that the recipient'' s inbox is full and cannot receive any more messages!' );
641
+
624
642
raise Exception.Create(E.Message);
625
643
end ;
626
644
end ;
@@ -672,7 +690,7 @@ function TSendEmail.Disconnect: TSendEmail;
672
690
FIdSMTP.Disconnect(False);
673
691
Log(' Disconnected' );
674
692
except
675
- Log(' Disconnected with error' );
693
+ Log(' Except: Disconnected with error' );
676
694
end ;
677
695
678
696
if FSSL or FTLS then
@@ -796,4 +814,4 @@ finalization
796
814
797
815
FreeAndNil(TSendEmail.RW);
798
816
799
- end .
817
+ end .
0 commit comments