Error conditions

The Mail command fails if the mail server reports an invalid recipient or an empty recipient. In that case, the mail message is not sent. This is the safest approach as it does not ignore errors.

To send mail to a list of recipients, use a separate Mail command for each recipient and handle possible errors.

This command only validates recipients against the local mail server. It catches errors such as badly formatted email addresses, but it does not non-existent remote addresses. In other words, the validation does not guarantee that a message is delivered at the destination.

To send emails to a list of recipients where some entries in that list could be empty, use the following scripting to filter out the empty recipients out.

Filter empty recipient entries.

Var Text Rcpts = "";
Var Text Rcpt; 
ForEach Rcpt In <original list> Do 
  If Rcpts = "" Then 
    Rcpts = Rcpt; 
  Else 
    Rcpts = Rcpts + "," + Rcpt; 
  Fi; 
Od;

The ForEach commands skip empty items and filter the list in the process. The original list must be comma-separated.