Email delay using PHP

This is a discussion on "Email delay using PHP" within the PHP Forum section. This forum, and the thread "Email delay using PHP are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > PHP Forum

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Jan 28th, 2006, 13:23
Reputable Member
Join Date: Nov 2005
Posts: 127
Thanks: 0
Thanked 0 Times in 0 Posts
Email delay using PHP

Does anyone know why I am getting an email delay using php. I made a form to email me comments in php and theres a massive delay of up to 2 hours from when I send the email to when its recieved by the pop3 box. The email address is being sent to an internal email address (i.e. an address on the same domain as that thats sending the message). I asked the hosting why the delay is occuring and they say the script is fine and the problem is with the pop3 box picking the message up, they told me they would get their engineers to sort this but then sent me a huge free script they got from somewhere in perl and told me to use this, adapting the parts that need adapting (when i know nothing about perl). They say this will work but i can't even get the file to be displayed (i uploaded to cgi-bin and set permissions to 755 but i get an error saying cgi may not be enabled)
Reply With Quote

  #2 (permalink)  
Old Jan 29th, 2006, 06:25
Reputable Member
Join Date: Jul 2005
Location: Melksham, Wilts, UK
Posts: 293
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Email delay using PHP

If I was trying to sort this out, the first thing I would do is to look at the raw email headers on a delayed email and see if I could work out where the delay is occurring. Although you describe the email as being an "internal" one, it's quite likely that you're using an external or world-visible mail and web server, and your emails that you think are local may have some quite complex routing.

--Graham
Reply With Quote
  #3 (permalink)  
Old Jan 29th, 2006, 11:16
Reputable Member
Join Date: Nov 2005
Posts: 127
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Email delay using PHP

Hi,
What would I be looking for in the headers?
The reason I think its internal is because if i change the destination address to an external one, it works instantly and the person I spoke to at the hosting said it was being sent imediately but the delay was happening in the pop3 box collecting it.

Also if I send an email to the destination address via an outside address I recieve it immediately

At the minute im using mail(), is there another method you think would be better?

Any help is much appreciated.

Last edited by djme; Jan 29th, 2006 at 11:46.
Reply With Quote
  #4 (permalink)  
Old Jan 29th, 2006, 16:55
Reputable Member
Join Date: Jul 2005
Location: Melksham, Wilts, UK
Posts: 293
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Email delay using PHP

mail() is the right function to use.

As I don't know your full setup I can't comment in the exact place where the mail is getting stuck ... but you also ask about reading the headers. Here's an example:

Code: Select all
Received: from wellho.net ([64.62.240.12]) by wellho.net for <gje@wellho.net>; Sun, 29 Jan 2006 09:24:02 -0800
Received: from moutng.kundenserver.de ([212.227.126.171]) by wellho.net for <graham@wellho.net>; Sun, 29 Jan 2006 09:23:59 -0800
Received: from [64.62.240.12] (helo=wellho.net) by mx.kundenserver.de (node=mxeu11) with ESMTP (Nemesis), id 0MKuA8-1F3GCW2RWQ-0000UB for graham@sheepbingo.co.uk; Sun, 29 Jan 2006 18:18:57 +0100
Received: from 82.33.81.221 ([82.33.81.221]) by wellho.net for <graham@sheepbingo.co.uk>; Sun, 29 Jan 2006 09:18:50 -0800
reading from the bottom up ....
the email left the system of origin at 09:18:50
it was passed on to the next system at 09:18:57 (but there was a 9 hour time zone change)
it seems to have stuck there for a few minutes as the next receipt is 09:23:59
and it rapidly moved on the final step at 09:24:02

so I can tell that the delay of 6 minutes was caused in Germany. Knowing where the problem is then lets me get onto fixing it, or to doing something about the mail routing to avoid that system - I could do that by moving my sheepbingo mail forwarder, for example.
Reply With Quote
  #5 (permalink)  
Old Jan 29th, 2006, 16:57
Reputable Member
Join Date: Jul 2005
Location: Melksham, Wilts, UK
Posts: 293
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Email delay using PHP

djme - hope you can make sense of my previous post. The forum software here has chosen to edit the code reported email header to remove email addresses which, as I was talking about email forwarding and addresses, obfuscates my point!
Reply With Quote
  #6 (permalink)  
Old Jan 29th, 2006, 19:28
Reputable Member
Join Date: Nov 2005
Posts: 127
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Email delay using PHP

Yes thanks, i think I got the main points.
Once Ive located the delay, how would I go about setting up a different forwarder. The delay on mines about 2 hours so its quite unacceptable. Thanks for the help
Reply With Quote
  #7 (permalink)  
Old Jan 29th, 2006, 21:08
Reputable Member
Join Date: Nov 2005
Posts: 127
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Email delay using PHP

HI Graham,
Ive looked at the header and it seems to be direct pretty much with it saying recieved by.... at 9.00, recieved by..... at 10.12, so it looks like the delay is here, is there anything I can do about this
Reply With Quote
Reply

Tags
email, delay, using, php

Thread Tools

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
email jasonjkd Web Page Design 9 Nov 12th, 2007 22:36
Reducing Pre-Load delay ClrWtrDsgnr Flash & Multimedia Forum 8 Oct 18th, 2007 20:48
PHP email form not sending email Kurt PHP Forum 1 Oct 12th, 2007 04:26
Form submits to email via php, but email is blank!!?? DH1234 PHP Forum 2 Jun 18th, 2007 10:42
Rollover delay problem, please help! stealthmonkey JavaScript Forum 11 Feb 12th, 2006 02:24


All times are GMT. The time now is 07:24.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43