Board index » delphi » Emailing to a LIST of addresses (Indy 10) freezes.

Emailing to a LIST of addresses (Indy 10) freezes.


2007-04-19 05:18:56 AM
delphi179
Hi
I am pretty new to this area.
I have an App that sends a message to a list of addresses (66 total, in my
test).
The code is this:
SMTPsetup;
SMTP.Connect;
try
for i:=0 to List.count-1 do
emailit(List[i].address,msg)
finally
SMTP.Disconnect;
end;
where SMTPsetup sets the TIdSMTP component's username, port, and host
and emailit sets the TIdMessage component body.text, extraheaders,
recipietns etc.
and then uses a Send to actually send the email.
This all works fine for about the first 30 elements in the list, then the
app freezes.
Any help? The App should be able to email much larger lists, what amI doing
wrong?
Thanks
Enrico
 
 

Re:Emailing to a LIST of addresses (Indy 10) freezes.

"E.P." <XXXX@XXXXX.COM>writes
Quote
This all works fine for about the first 30 elements in the list,
then the app freezes.
Any help? The App should be able to email much larger lists,
what amI doing wrong?
There is no way to know yet. You haven't provided enough details,
such as what emailit() is actually doing with the TIdMessage.
Gambit
 

Re:Emailing to a LIST of addresses (Indy 10) freezes.

Thanks.
emailit does this (pseudo and actual code):
while not custfile.EOF do begin
read_cust_info;
IdMsgSend.Clear; // TIdMessage component;
with IdMsgSend do begin
From.Text :=info.myemail;
ReplyTo.EMailAddresses := info.myemail;
Recipients.EMailAddresses := info.toemail;
Subject := blah blah;
Body.text:=getemailbody;
ExtraHeaders.Add('MIME-Version: 1.0');
ExtraHeaders.Add('Content-Type: multipart/alternative;');
ExtraHeaders.Add(#9'boundary="----=_BOUNDARY_LINE_"');
SMTP.Send(IdMsgSend);
end;
next;
end;
If there are no other errors somewhere else, would this loop be executed
ok for say 200-300 hundred customers? Or it would it "jam" the SMTP.Send
queue?
Thanks again
"Remy Lebeau (TeamB)" <XXXX@XXXXX.COM>writes
Quote

"E.P." <XXXX@XXXXX.COM>writes
news:46267020$XXXX@XXXXX.COM...

>This all works fine for about the first 30 elements in the list,
>then the app freezes.
>Any help? The App should be able to email much larger lists,
>what amI doing wrong?

There is no way to know yet. You haven't provided enough details,
such as what emailit() is actually doing with the TIdMessage.


Gambit


 

Re:Emailing to a LIST of addresses (Indy 10) freezes.

"E.P." <XXXX@XXXXX.COM>writes
Quote
ExtraHeaders.Add('MIME-Version: 1.0');
ExtraHeaders.Add('Content-Type: multipart/alternative;');
ExtraHeaders.Add(#9'boundary="----=_BOUNDARY_LINE_"');
Why are you doing that? You should not be doing that in the first
place. TIdMessage manages those headers for you. You should be using
the TIdMessage.MessageParts collection to create proper MIME-encoded
emails. Otherwise, you are risking creating malformed emails.
Quote
If there are no other errors somewhere else, would this loop
be executed ok for say 200-300 hundred customers?
It should be, provided that you are not thoroughly confusing
TIdMessage and making its encoding system lock up. Which should not
happen, so any{*word*154} that does occur is likely on the socket itself.
Quote
Or it would it "jam" the SMTP.Send queue?
There is no queuing involved.
Gambit