emails sent via php taking a long time

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
oboedrew
Forum Commoner
Posts: 78
Joined: Fri Feb 20, 2009 1:17 pm

emails sent via php taking a long time

Post by oboedrew »

Here's another email question for all you php gurus. I'm setting up a "contact me" form on my website for the first time, and the test messages I send to myself through this form take a long time to show up in my inbox. Sometimes a few hours, sometimes a day or two. Is it normal for messages sent via php's mail function to take so long to arrive? Or is this perhaps a server problem?

Thanks,
Drew
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Re: emails sent via php taking a long time

Post by Benjamin »

Is this a shared hosting setup? There may be a large mail query causing your message to just wait in line.
oboedrew
Forum Commoner
Posts: 78
Joined: Fri Feb 20, 2009 1:17 pm

Re: emails sent via php taking a long time

Post by oboedrew »

What exactly is a "shared hosting setup?" I don't have my own server, if that's what you mean, so I use a remote web host. Is this sort of email traffic jam common in such cases?

Thanks,
Drew
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Re: emails sent via php taking a long time

Post by Benjamin »

Shared hosting means that there are many other sites on the same server. There is a good chance that the host is routing the mail from all the sites, even sites on other servers through a common mail server. That mail server may be running behind due to the load. I would ask your host about it.
oboedrew
Forum Commoner
Posts: 78
Joined: Fri Feb 20, 2009 1:17 pm

Re: emails sent via php taking a long time

Post by oboedrew »

Well, I sent an email to my host to get their take on the issue. Meanwhile, I'd like to know if this is a typical (perhaps even inevitable) problem with shared hosting. Does everyone who doesn't have their own server have to deal with such a delay? Or is this perhaps a good reason to start looking for a new hosting company?

Thanks,
Drew
Post Reply