View Full Version : php mail() is slow...returns after a long wait
mechamecha
11-15-2007, 03:36 PM
Hello,
I've noticed that the php mail() function periodically takes a long time to return....almost up to 20 secs.
Is anyone else experiencing this problem?
Is there a solution to speed it up? Or perhaps a work around?
Thanks
Are you talking about the time it take the PHP page that has the mail function to load or the wait to receive the email?
20 seconds is a reasonable return time, actually quite a fast return time.
Remember, there are almost 500 other users on the same server, sometimes it's not always going to be instant.
mechamecha
11-15-2007, 04:12 PM
I'm talking about the time it takes to load the page w/ the php function in it.
if i write a simple php script w/ just the mail() function and execute it from the commandline, it takes a while for the call to return back to the shell.
Is there some way I can queue the mail() function? The problem I have w/ my site is its dependent on the mail() function returning instantaneously so that the user doesn't experience the delay. If i could save off the mail job for later, it would appear to the user that the email was sent immediately.
thanks
If i could save off the mail job for later, it would appear to the user that the email was sent immediately.
I'm not aware of any way of making the execution time of PHP any faster. If you wanted to save it for later, add it to a que in a database and then eaither manually send it or use a cron to send it for you.
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.