DreamHost Web Hosting
Discussion Forum


Forums
   >> E-Commerce
*Threaded Mode

Subject php mail() too slow, workarounds?  
Posted byhere (DH Dreamling)
Posted on07/16/06 06:19 PM




php mail() function is too delayed to provide reliable notification following web purchase.

A client is attempting to sell a service requiring immediate action via their site. When a customer places an order, the information is recorded into a database and an email is sent to both the customer and provider using php's native mail() function. These mails have been arriving occasionally delayed - sometimes immediately; sometimes 6+ hours late! This seems to be par for the course with the current dh setup and has been consistetly erratic for the past 2 weeks.

The order shows up immediately in the database. Unfortunately, the provider has no idea there is a new order without constantly refreshing a database view!

Is there a way to eliminate the delay with mail()?

Is there an alternative to mail() which will eliminate the delay?
* PEAR:Mail : http://pear.php.net/package/Mail
* phpmailer: http://phpmailer.sourceforge.net/
* p3mailer: https://sourceforge.net/projects/p3mailer/
* email() from POSS : http://poss.sourceforge.net/email/index.php?type=Documentation

Does someone have a better idea than email as to how to contact about a new order. (maybe Jabber?)

Thanks

See also
* http://discussion.dreamhost.com/showflat.pl?Cat=&Board=forum_programming&Number=33763


. .. ...:herebox.org:... .. .


Subject Re: php mail() too slow, workarounds? new [re: here]  
Posted byscjessey (DH Pooh-Bah)
Posted on07/16/06 06:43 PM



In reply to:

php mail() function is too delayed to provide reliable notification following web purchase.


I disagree. I have found the mail() function to be completely reliable. Any delays I have experienced have been Sendmail issues, as far as I can tell.

--------
Simon Jessey | Keystone Websites
Save $97 on yearly plans with promo code SCJESSEY97

Subject Re: php mail() too slow, workarounds? new [re: scjessey]  
Posted byhere (DH Dreamling)
Posted on07/17/06 06:17 AM



Thanks for the thought! Could you maybe expand a bit? Your current response doesn't really get me anywhere. Does that mean I am not using sendmail correctly? I am using simply mail($email, $subj, $text, $headers); .

Across the past two weeks I've been testing this service, emails have been regularly delayed following the form submission.

If this is a sendmail issue -- then the same question applies -- how do I work around the sendmail delays?

The service being sold is one that would be ideally /completed/ within 15 minutes of purchase. That means a delay of even 10 minutes is the upper limit of acceptibility. I realize there are a huge number of factors which can delay email -- but these delays appear to be somewhere between php and dreamhost.

. .. ...:herebox.org:... .. .

Edited by here on 07/17/06 06:23 AM (server time).



Subject Re: php mail() too slow, workarounds? new [re: here]  
Posted byscjessey (DH Pooh-Bah)
Posted on07/17/06 07:34 AM



In reply to:

Does that mean I am not using sendmail correctly? I am using simply mail($email, $subj, $text, $headers); .

Across the past two weeks I've been testing this service, emails have been regularly delayed following the form submission.

If this is a sendmail issue -- then the same question applies -- how do I work around the sendmail delays?

The service being sold is one that would be ideally /completed/ within 15 minutes of purchase. That means a delay of even 10 minutes is the upper limit of acceptibility. I realize there are a huge number of factors which can delay email -- but these delays appear to be somewhere between php and dreamhost.


You are definitely using mail() correctly (see this wiki article for confirmation). The problem is definitely within the mail server, and it is intermittent. I just tested four of my forms, and I received all four emails immediately. I don't know of any way to get around the problem, I'm afraid, but it normally works just fine.

--------
Simon Jessey | Keystone Websites
Save $97 on yearly plans with promo code SCJESSEY97

Subject Re: php mail() too slow, workarounds? new [re: scjessey]  
Posted byhere (DH Dreamling)
Posted on07/17/06 10:59 AM



here is another report, also across weeks, describing almost exactly my symptoms. somtimes immediate, but often delayed and delivered in bunches.

looks like you were right in pushing the problem past php's mail() and onto sendmail.

thread in programming forum: sendmail Delays for Hours?

. .. ...:herebox.org:... .. .


Subject Re: php mail() too slow, workarounds? new [re: here]  
Posted byetechsupport.net (DH New User )
Posted on07/25/06 02:51 PM



Mail queue on your server has become huge and it shoould be cleaned to keep sendmail service running all the time. There maybe someone spamming from the server which is crashing sendmail service.

http://www.etechsupport.net



*Threaded Mode
Jump to