If you are using Indy 10 then you need to assign a handler to the TIdSMTP.OnFailedRecipient
event and have it set the VContinue
parameter to True.
procedure TForm1.IdSMTP1FailedRecipient(Sender: TObject; const AAddress, ACode,
AText: string; var VContinue: Boolean);
begin
// do something...
VContinue := True;
end;
That will allow TIdSMTP
to skip the failed recipient and keep sending the email to the remaining recipients. Only if all of the recipients fail will TIdSMTP
then fail the send (unless some other non-recipient error occurs, of course).
If you are using Indy 9 or earlier, or do not provide an OnFailedRecipient
handler, TIdSMTP
will fail and abort the send on the first error encountered, including a recipient error.
The SMTP server will NOT send a notification to the sender's inbox if it actively rejects a given recipient while the email message was still in process of being given to the server by the sender. You will have to use the OnFailedRecipient
event to act upon that recipient. Only recipients that are accepted by the server and then later found to be in error will then send a notification to the sender's inbox accordingly. That is simply how SMTP works.