Mass e-mailing with PHP versus PHP CLI

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
holic
Forum Newbie
Posts: 1
Joined: Wed Feb 22, 2006 1:33 am

Mass e-mailing with PHP versus PHP CLI

Post by holic »

Hello,

can you share your experiences with sending several emailis in PHP.

I've ordered a script from a software company which has to send email notification about orders to approximately 50 different persons. Everything works fine except when there is a wrong email address in the mailing list, the script will be dead and none of the recipients that are "under" the wrong email, will not get the message.

They are using currently PHP standard mail function and send all emails one by one over HTTP.

Is there any good solution for the situation, the best would be when I can check if the email exists and if not, send the notification to administrator to fix it.

I've got recommendation to use PHP CLI - Command line interface, to send out the emails, supposedly all processes will be finished, or at least one failure won't mess others.

Software company tells me that I should configure the mail server to not verify email addresses.

The last one sounds a bit strange, although it can work now, I'd like to remain server independent.

Hope you can help me with your suggestions.

Thank you.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Using a PHP mail client can help a lot. phpMailer can interact directly with an SMTP server and can keep the connection open allowing you to send multiple emails at a time. For large batches (50 isn't large) I'd research using CRON or something similar to run the mailing script every so often to send out a batch, since many hosts (shared mostly) limit the mail you can send within a given period of time.
Post Reply