PHP mail() Fails on Mass Emails

software development

#1

I’m running a community pool website where I’ve enabled a mail form for the president to send emails to pool members.

This code worked fine on my other host. Sometimes, if over 300 mails were sent, I broke up the mail() function into 3 seperate processes as to not break the system with so many mails in the BCC header.

However, I just switched to Dreamhost and now my code is not working. It does work with less than 20 addresses, but when more than that, it breaks.

First of all, is there a way I can see the PHP logs? (because it’s failing silently and I don’t know why)

Second, do you guys know if Dreamhost has placed a limit on the BCC header value to only allow a limited amount of addresses?

I can tell you that this isn’t a “lagging” issue where the emails will be sent eventually. It’s failing immediately without even trying to the send the mails.

Basically I have a:

if(mail(…))
echo “Successful”;
else
echo “Failure”;

And I keep getting the failure message when sending mails to many (over 20 or so) people. But again, this works when sending less than 20.

Thanks,
greenmile@operamail.com


#2

Use an announce list - really.


#3

Actually, the way my system is set up, using an announce list doesn’t really help.

See, I created a graphical representation of our member database that the board members and filter by pool association. (for example, they can filter to only swim team families, dive team families, people on the tennis team, etc.)

Sometimes the board members may only want to send emails to a select group of emails off the database. Because of this, using a announce list would not work.

I’m hoping that one of the dreamhost admins could lift the 20-email limit on the mail() function (maybe just for my site?), that would really help.


#4

I’ve solved this problem by writing out control files from the webserver to disk and then running a stand alone program out of cron periodically to do the mailing.

If you do this, you can just run your php script out of cron and loop over the list of email addresses sending a fresh mail to each person (instead of cc’ing).

Just stay under 1000 emails an hour and dreamhost won’t spank you.


#5

I apologize but I wasn’t sure what forum to post to so I decided to jump in here.

A friend is helping me build the equivilent to a yahoo group and I wanted to use my DreamHost account. Here is the problem he is having I hope you will understand because I don’t:

"Joseph…

There seems to be a dealbreaker with putting the site on a DreamHost server.

Their implementation of PHP (the language that most interactive sites use nowadays) does not include support for a process called imap_open()

This is necessary to have PHP read a mailbox and extract messages from it. So basically if we wanted to continue the mail-your-post-in method, we cannot do it there.

I have spent most of the day trying to figure out how to recompile PHP for your websites but it seems to be over my head. I will perhaps try a bit more this weekend but otherwise, we may have to figure something else out."

===========

does any of this make sense to you all? If so is there a solution I can pass on to him? thanks for any help with this.

Joseph Puentes
http://NuestraFamiliaUnida.com


#6

Well, your friend partialy has the right idea about fixing this issue. You can’t re-compile php for your account, but you can compile your own version. The difference here is re-compiling php on the server would effect everyeone on your shared server, but you can compile your own version of php4 or 5 and set your pages to use your own install.

Check out the Wiki for Instructions

Hope that made sense.

-Matttail


#7

Could we see the code? I send an email to 30 people and it seems to go fine. The code iterates through the email addresses so each email is individual.