Page 1 of 1

[SOLVED] E-mailing different messages to many users

Posted: Mon Mar 29, 2004 11:49 am
by enzymecoding
Hello,

I am looking for a script to send different messages to
>1000 email addresses. I found some suggestions in
this forum very interesting.

1- Some say the mail() function is no good for sending
mass emails, probably because a socket is opened for
every single email. Correct?

2- But because I need to send different messages to different
addresses, and I can't use the ability of SMTP to send the same
message to many different users. Should I still use SMTP?

3- What does the mail() function use for sending mail? Where
can I find the source code for it?

4- How good are other mail scripts (like PEAR-Mail) for my task?


Thank you for helping a novice! 8)

Posted: Mon Mar 29, 2004 12:35 pm
by lostboy
Mail uses the SMTP server. The real problems are the sockets and the load on the mail server. It might be a good idea to limit the number of emails sent at any one time to 500 or 1000, then have the machine sleep for a while to get the mailserver caught up before beating on it again...

Posted: Mon Mar 29, 2004 1:14 pm
by Steveo31
Look up chron jobs.

Posted: Mon Mar 29, 2004 1:17 pm
by Illusionist
Steveo31 wrote:Look up chron jobs.
i thin you mean cron, and how would they help in this case anyway??

Posted: Mon Mar 29, 2004 1:56 pm
by Steveo31
Yea... thats it.

I thought those were for mass mailings, timed or somethin. If not I apologize.

Posted: Mon Mar 29, 2004 2:05 pm
by Illusionist
on a *nix machine you can use cron jobs like you would use MS Task Scheduler on a Windows machine.

Posted: Mon Mar 29, 2004 2:21 pm
by enzymecoding
Lostboy: Thanks for your reply! Are you saying that the
mail() is just as good as doing it manually, since it also
uses SMTP, as long as I let it rest?

I wonder if anyone would use the manual method:
- opening a socket to SMTP
- packaging the mail in an env
- sending it using 'RCPT TO:'

if they are sending different messages to large numbers of users...

Posted: Mon Mar 29, 2004 2:37 pm
by m3mn0n
Illusionist wrote:
Steveo31 wrote:Look up chron jobs.
i thin you mean cron, and how would they help in this case anyway??
Instead of mailing everyone at one single momment in time. You could schedule 100 emails to be sent every 5 mins until the list is complete.

This would reduce the server load, and also make it very possible to use the standard [php_man]mail[/php_man]() function.

(And yeah, the topic should be mail() vs. sockets; since the backbone of any e-mailing application is infact an SMTP server. ;))

Posted: Mon Mar 29, 2004 3:43 pm
by enzymecoding
I will try that.

Thank you all for your help. I really appreciate this.

Posted: Mon Mar 29, 2004 4:00 pm
by m3mn0n
No worries. :)