CGI vs PHP mailer

Started by Spaceman-Spiff, August 02, 2003, 01:31:36 PM

Previous topic - Next topic

Spaceman-Spiff

since the php scripting help section is closed in yse.org, im reposting here:

I have a newsletter script running in my website, sending 1500 emails every week, it's currently using php mail() function, but it's very slow. I've tried both sendmail and SMTP, and both has the same speed. I also tried making the script sends 25 emails at a time, rests for 4 secs, then send another 25 until 1500 mails are sent, and it's still slow.
I read somewhere that hints a CGI Mailer is faster than a php script. Is this true? Or is my webhost mail server just slow?
What are the advantages using a CGI mail script instead of PHP? or vise versa

How many seconds/minutes does it take for this forum to send out annoucements?

Zef Hemel

Perl scripts usually pipe it's stuff right into sendmail, what PHP does depends on the setting in php.ini, I think you can switch there between using sendmail directly and contacting a SMTP server. Using perl probably won't speed it up, your hosts probably just has a slow mail server.

Spaceman-Spiff

i guess it is the mail server, i'll try changing SMTP server
the hosting is using verio. i don't like them, but my client insist in using them. they're even running php through CGI, not mod_php

thx for the answer Zef

Parham

Sending out 1500 emails in bulk... I would imagine it would be slow either way to some degree.  I like your idea of sending them in batches and then giving it some breathing time.  But either way, I would imagine that the mail server would experience some sort of lag while you send out that many emails :).  Just my opinion, not basing this off any facts.

Spaceman-Spiff

currently its takes about 5-25 seconds to send 25 emails
takes about 15 minutes to send everything, i say that's pretty long

Douglas

Why not just use a mailing list server?  Would be quicker, you send one email, the mailing list server handles the rest of it for you.
Doug Hazard
* Full Stack (Web) Developer for The Catholic Diocese of Richmond
(20+ Diocesan sites, 130+ Church sites & 24 School sites)
* Sports Photographer and Media Personality
* CFB Historian
* Tech Admin for one 1M+ post, one 2M+ post and one 10M+ post sites (last two are powered by multiple servers)
* WordPress Developer (Junkie / Guru / Maven / whatever)

Rochen

It's very possible that your hosting provider may have flood controls in place to help prevent malicious users from mail-bombing as easily using their service.

Running PHP as a CGI? More power to them! Running PHP as a CGI is a fantastic idea as it makes tracking stuff like abusive users a dream come true. It adds to the overall server load, but reduces the individual load on the Apache service.

However, using the CGI version of PHP does have some falls backs like PHP configuration options can't be set in a htaccess file. We haven't personally implemented it though, due to user feedback and dislike at the idea.

As said above, the only difference in the speed between PHP and CGI mailers would be the php.ini configuration. At the end of the day though, it comes down to the mail server configuration.

Verio are generally a top-notch hosting provider, so I would advise you contact them (if you haven't already) and see what they have to say about the whole issue. There isn't much more we can suggest here without knowing how Verio have their mail server's setup.

Good luck! :)

Chris
Chris Adams – Rochen Ltd. – [email protected]
- Multiple Domain Hosting & Reseller Hosting
- www.rochen.com [nofollow]

Advertisement: