Sendmail to list of records

Sendmail to list of records

Hi,

I searched but didn't find anything...

I want to send an automatic email to a list of people in a form, based on a date of delivery.

Here is what I did :

CourrielFerme = "info@fermerondine.com";
Demain = zoho.currentdate.addDay(2);
PointLivraison = Calendrier_maitre[Date_Livraison = Demain].Point_de_livraison;
for each  Courriel_Abonne in Calendrier_maitre[Date_Livraison == Demain]
{
    sendmail
    [
        from :CourrielFerme
        to :Courriel_Abonne
        subject :"Livraison de panier de légumes bio DEMAIN"
        message :"Bonjour, votre panier de légumes sera livré demain au point de livraison de " + PointLivraison
    ]
}

But it only sends emails to the first record, that receive it the number of time equals to the number of records in the list.

I'm sure it is a simple glitch that I cannot figure...

Sylvain