Forum Moderators: coopster

Message Too Old, No Replies

php mail()

         

artie2004

4:08 pm on Aug 30, 2006 (gmt 0)

10+ Year Member



Hello

I am working on a job board for a client and i am trying to do a mass email to all jobseekers(there are currently over 1000 jobseekers).

I am using the php mail() function in a loop. When i try to send out emails to just some of the jobseekers, it works fine. But when i try to send out emails to all the jobseekers, i am getting the following error:

Warning: mail() [function.mail]: Could not execute mail delivery program '/usr/sbin/sendmail -t -i' in /home/ployjam/public_html/admin/emailall.php on line 63

Warning: mail() [function.mail]: Could not execute mail delivery program '/usr/sbin/sendmail -t -i' in /home/ployjam/public_html/admin/emailall.php on line 63

Warning: mail() [function.mail]: Could not execute mail delivery program '/usr/sbin/sendmail -t -i' in /home/ployjam/public_html/admin/emailall.php on line 63

Warning: mail() [function.mail]: Could not execute mail delivery program '/usr/sbin/sendmail -t -i' in /home/ployjam/public_html/admin/emailall.php on line 63

Warning: mail() [function.mail]: Could not execute mail delivery program '/usr/sbin/sendmail -t -i' in /home/ployjam/public_html/admin/emailall.php on line 63

Warning: mail() [function.mail]: Could not execute mail delivery program '/usr/sbin/sendmail -t -i' in /home/ployjam/public_html/admin/emailall.php on line 63

Warning: mail() [function.mail]: Could not execute mail delivery program '/usr/sbin/sendmail -t -i' in /home/ployjam/public_html/admin/emailall.php on line 63

etc.....

barns101

4:20 pm on Aug 30, 2006 (gmt 0)

10+ Year Member



It the code to send an email to all subscribers any different from when you sent emails to a select few? Maybe you're trying to send too many emails at once and it's overloading your account?

Although I must admit to using mail() in a loop to send email to 1300+ subscribers of mine, it is not the best way to do it. I think you should be accessing sendmail directly when sending that many emails. (I'll figure out how to do it some day soon! ;) )

jatar_k

4:59 pm on Aug 30, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



does it give these warnings right away or is it after a certain number of iterations?

artie2004

6:08 pm on Aug 30, 2006 (gmt 0)

10+ Year Member



Hello

I am not sure. I added my email address into the database to make sure the email was being sent. i ran it several times and sometimes i got an email and sometimes i didn't. Thanks.

artie2004

6:12 pm on Aug 30, 2006 (gmt 0)

10+ Year Member



i found this note at [us3.php.net...]

Note: It is worth noting that the mail() function is not suitable for larger volumes of email in a loop. This function opens and closes an SMTP socket for each email, which is not very efficient.

For the sending of large amounts of email, see the PEAR::Mail, and PEAR::Mail_Queue packages.

has anyone used this before?

jatar_k

6:19 pm on Aug 30, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



not me

try using a counter to isolate where it dies if you like

I am guessing it is a throttle from your ISP as barns mentioned above

my ISP used to stop around 500 consecutive emails. I used to stage them over time, sending 25k over 24 hours or so. used a cron that would grab a chunk and setup the emails and fire them into the mail queue.

I also have written the emails to their own file, kind of a pseudo queue, as they aren't waiting in the actual mail queue. I had a cron that would check to see if there was anything in that file, then append whatever was there to the real queue.

both worked, we also had our own mail servers so we had a little more access to things.

the key is, email sucks ;)

artie2004

6:43 pm on Aug 30, 2006 (gmt 0)

10+ Year Member



okay. thanks.