
November 13th, 2003, 05:26 PM
|
|
Junior Member
|
|
Join Date: Nov 2003
Posts: 1
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
mail() taking long time to execute...reason?
I built a basic page that writes data from a form into a MySQL database, and also sends an email to the person who filled out the form as well as a site admin. The SQL connection and the mail() functions work, however, once in a while it takes a very long time for the mail function to execute. When hitting the submit button, the data is written to the DB immediately, but the mail does not send right away. The form stays on the screen, and the browser is in a "working" mode. This doesnt seem to affect the function, as the emails still go out (eventually). The main problem is that the form stays on the screen, and it appears that nothing is happening, so the lovely end users like to click the submit button again, thus entering the data into the DB more than once.
So, I guess my question is: is this a possible problem in my script? Or is the delay caused by the hosting server? Its a pretty basic script, with two 'mail($to, $subject, $message, $from);' fuctions. Any advice is appreciated.
|