Forum Moderators: coopster

Message Too Old, No Replies

Mass email without sendmail

What other options are available?

         

barns101

2:13 pm on Sep 2, 2006 (gmt 0)

10+ Year Member



I currently use the mail() command in a loop to contact 1300+ subscribers. Recently every email is getting bounced back saying that the subscriber has an "unrouteable mail domain" (although they have been working for years). I don't think it's a general problem with mail(), because I can still use it in a loop to send smaller numbers of emails. So, I assume it's a restriction on the number of calls to mail() at one time, or something like that.

I then tried using Pear::Mail, but found that popen() was disabled for security reasons and fopen() gives me the following error:

Warning: fopen(/usr/sbin/sendmail/): failed to open stream: Permission denied in /home/path/to/script.php on line 20

So it looks like I can't use sendmail, either. :(

What other options are open to me? The only other thing that I can think of is to continue to use mail() in a loop but to pause the script after 500 emails or so.

(I have emailed by host to ask what they suggest, too.)

jatar_k

3:03 pm on Sep 2, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



the pausing was what I always did

do 100 every 5 minutes or so, whatever threshold works. I used a db to manage the mailout.

barns101

3:22 pm on Sep 2, 2006 (gmt 0)

10+ Year Member



Thanks for the advice. So you still used mail()?

How did you cope with a script maximum execution time if it was only sending 100 emails every 5 minutes? Or did you have some way of running the script on separate occasions and it recognised which people had and had not been emailed yet? Was it the solution that you mentioned here [webmasterworld.com]?

jatar_k

3:50 pm on Sep 2, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



yes, using mail(), yes the 25k in 24 hrs one

I dumped the emails into a db table
email, datetime, customer id and a sent column

then running a cron

select email from tablename where sent='no' limit 100;

as I loop through set sent='yes' after each email is sent.

then stop, cron starts again

we also had a requirement to track opt ins response etc, that was all managed in a related table, we kept datetimes anytime a mailout was sent and who acted upon the email.

barns101

1:28 pm on Sep 3, 2006 (gmt 0)

10+ Year Member



Thanks again for the advice jatar_k :)