Urgent! #4.x.2 Too Many Messages for This Session

Giganews Newsgroups
Subject: Urgent! #4.x.2 Too Many Messages for This Session
Posted by:  Fita (sistem…@colegiosangabriel.edu.ar)
Date: Wed, 24 Jun 2009

Hi.

I develop a college system and I try to send mails to every family  in the
database, so we need
send 2 mails for every family (mother and father).
Every mail must be a personal mail; that's why we need send one for each.

After the third family (6 mails) I get the error:  #4.x.2 too many messages
for this session

this is the routine: (Delphi 2007 - Indy 10)

smtp.connecttimeout := 30000;
smtp.connect;
// here the mail parameters address, from, subject, body etc...

                        while not Alu000.Eof do
                        begin
                              Fam000.Locate('codfam', Alu000Codfam.Value,
[loCaseInsensitive]);
                              cDestinatario := 'Enviando a Flia: ' +
Fam000Denominacion.Value;

                              if (Fam000Emailp.value <> '') then // the
father
                              begin
                                  Memo2.Lines.Add( cDestinatario ); // memo
displaying status
                                  Mail.Recipients[0].Name := 'Family: ' +
Fam000Denominacion.Value;
                                  Mail.Recipients[0].Address :=
Fam000Emailp.Value;
                                  smtp.Send(Mail);
                              end;
                              if (Fam000Emailm.value <> '')  then // the
mother
                              begin
                                  Memo2.Lines.Add( cDestinatario ); // memo
displaying status
                                  Mail.Recipients[0].Name := 'Family: ' +
Fam000Denominacion.Value;
                                  Mail.Recipients[0].Address :=
Fam000Emailm.Value;
                                  smtp.Send(Mail);
                              end;
                              Alu000.Next;
                        end;
smtp.disconect

any idea please ???

best regards !!

Replies