Slow contact form

the mail() function

Moderators: macek, egami, gesf

New php-forum User
New php-forum User
Posts: 1
Joined: Sat Jun 04, 2011 6:22 pm

Slow contact form

Postby Shaggy » Sat Jun 04, 2011 6:47 pm

Hello - I have a simple contact form that works; but after clicking submit, it hangs for several seconds before showing the "thank you" page. Can anyone offer insight? Is it most likely due soley to the mail server, or..?

User avatar
php-forum Fan User
php-forum Fan User
Posts: 981
Joined: Thu Feb 17, 2011 6:52 am
Location: Racine, WI

Re: Slow contact form

Postby Nullsig » Mon Jun 06, 2011 8:00 am

Do you write to the database? Or, do you just send out the mail?

Usually the mail server doesn't really slow down the system as the message is just thrown into a queue to be handled by the server, only checking that the message is actually queued.

If you are doing reads and writes to a database before (or even after) sending the message, your queries are probably unoptimized and slowing down the processing of the page.

Return to “PHP coding => Mail”

Who is online

Users browsing this forum: No registered users and 5 guests