General Programming Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingGeneral Programming Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old November 13th, 2003, 05:26 PM
trilks trilks is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 1 trilks User rank is Just a Lowly Private (1 - 20 Reputation Level) 
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.

Reply With Quote
  #2  
Old November 14th, 2003, 09:41 AM
dhouston's Avatar
dhouston dhouston is offline
Contributing User
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: May 2003
Location: Tennessee
Posts: 1,355 dhouston User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via ICQ to dhouston
The script's probably just having to sit in line to connect to the mail server. If it's sending out a bunch of mails, this can take a while. You can dodge the multiple submissions by having an onclick event that sets the submit button's "disabled" property to "true."

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingGeneral Programming Help > mail() taking long time to execute...reason?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
Stay green...Green IT