The best way is to use an email list manager. I remember someone suggesting
one, but I've totally forgotten it now.

Personally the way I would do it is take the first list and load all the
email addys into the Bcc field. Or break them up into small chunks of less
than 50 at a time, since trying to pop out an email with 1000 recipients
will get you flagged as spamming (which is at least an inconvenience to have
to talk with your admin) and could cause SMTP to choke.

But less than 50 at a time shouldn't do any harm.

Then finish up with all the emails in that list, then go to another function
to spit another round.

So I'd set up the function to take the ID of the list to email, which would
email all the users as mentioned above.

I'd have the function in a loop which checks how many lists there are, then
feeds them one at a time to the function.


Easy to alter later, and it's a weensy bit easier to debug.


--
Plutarck
Should be working on something...
...but forgot what it was.


""Nikhil Goyal"" <[EMAIL PROTECTED]> wrote in message
9c27h6$ift$[EMAIL PROTECTED]">news:9c27h6$ift$[EMAIL PROTECTED]...
> Yes, that is a sound approach. However I've checked it again, and again,
and
> again, and nothing pops up. It would be easier if I had an error
generated.
>
> I'll try to get my hands on the SMTP logs, will talk to the server admin
> about that. My code is sending data to the SMTP socket and monitoring
> responses for the SMTP server, and no error there. Here is how it goes
>
> HELO xxx
> MAIL FROM: (me)
> RCPT TO: (recipient 1)
> DATA
> (body)
> .
> RSET
> MAIL FROM: (me)
> RCPT TO: (recipient 2)
> DATA
> (body)
> .
> (and so on...)
> QUIT
>
> I've noticed that the error shows up when the server load is high: for
e.g.
> when I am sending out emails to the lists, generally the first list goes
> through without a problem (i.e. one email per person). But when it moves
on
> to the second list, it starts sending two copies. But sometimes the second
> list goes okay, and the third generates duplicates.
>
> What _is_ the best way to send one email body to a dynamically generated
> list of email addresses???
>
> ""Phillip Bow"" <[EMAIL PROTECTED]> wrote in message
> 9c2570$56q$[EMAIL PROTECTED]">news:9c2570$56q$[EMAIL PROTECTED]...
> > Whenever you are positive its nto your code then check it again.  That
> being
> > said are there any SMTP logs you can check?  Have you monitored the
exact
> > data being sent to the SMTP server(maybe set up a dummy socket that
> repeats
> > back the data sent to it then have your program try to connect to that)?
> > --
> > phill
> >
> > ""Nikhil Goyal"" <[EMAIL PROTECTED]> wrote in message
> > 9c1ujm$868$[EMAIL PROTECTED]">news:9c1ujm$868$[EMAIL PROTECTED]...
> > > Hello people,
> > >
> > > I am having a peculiar problem with my mailing list and hope you can
> help
> > me
> > > out. I have a mySQL database with a table of email addresses for the
> > mailing
> > > lists. I have many lists, and my (PHP) code runs various queries on
this
> > > table to generate lists of email addresses to which the mail has to be
> > sent.
> > >
> > > The email body is combined with this generated list, and then I use
> mail()
> > > to send this message out to each recipient. I also add on a few
headers
> > such
> > > as From:, Errors-To, Reply-To and Return-Path to the message.
> > >
> > > Now the problem is that every recipient of my mail is getting two
copies
> > of
> > > the message. I am positive that it's not my code which is causing the
> > > problem, the script runs once and terminates. I've also tried to send
> mail
> > > by opening a socket connection to port 25 on the mail machine and
> sending
> > > SMTP commands, but still the result is the same. And there is no SMTP
> > error
> > > generated.
> > >
> > > Can anybody help me out here? or perhaps suggest a more efficient way
of
> > > sending out mail to my users? I'm really in a spot here...
> > >
> > > - Nikhil
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > To contact the list administrators, e-mail:
[EMAIL PROTECTED]
> > >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to