Simple Machines Community Forum

General Community => Scripting Help => Topic started by: Spaceman-Spiff on August 02, 2003, 01:31:36 PM

Title: CGI vs PHP mailer
Post by: Spaceman-Spiff on August 02, 2003, 01:31:36 PM
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 (http://www.webscriptworld.com/scripts/mlm.phtml) 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?
Title: Re:CGI vs PHP mailer
Post by: Zef Hemel on August 02, 2003, 01:34:40 PM
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.
Title: Re:CGI vs PHP mailer
Post by: Spaceman-Spiff on August 02, 2003, 01:55:01 PM
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
Title: Re:CGI vs PHP mailer
Post by: Parham on August 02, 2003, 11:02:43 PM
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.
Title: Re:CGI vs PHP mailer
Post by: Spaceman-Spiff on August 02, 2003, 11:21:29 PM
currently its takes about 5-25 seconds to send 25 emails
takes about 15 minutes to send everything, i say that's pretty long
Title: Re:CGI vs PHP mailer
Post by: Douglas on August 03, 2003, 12:02:14 AM
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.
Title: Re:CGI vs PHP mailer
Post by: Rochen on August 03, 2003, 02:22:01 PM
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