mail takes 1 minute

Discussion in 'Apache' started by stephan2307, Jun 2, 2011.

  1. #1
    I have the following code

    <?php
    echo date('H:i:s');
    $headers = 'From: XXXXXXX' . "\r\n" ;
    mail(XXXXXX,'test','test',$headers);
    echo date('H:i:s');
    ?>
    PHP:
    It takes exactly 1 minute to send this simple email.

    Does anyone have an idea where the problem could lie and how I can fix it?

    Thanks
     
    stephan2307, Jun 2, 2011 IP
  2. EvanP

    EvanP Banned

    Messages:
    1,731
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    0
    #2
    It's most likely your SMTP server used for sending mail that is the cause of the slight delay. Couldn't be sure without viewing server stats but it's quite possible.
     
    EvanP, Jun 2, 2011 IP
  3. stephan2307

    stephan2307 Well-Known Member

    Messages:
    1,277
    Likes Received:
    33
    Best Answers:
    7
    Trophy Points:
    150
    #3
    how can I get the server stats that you need?
     
    stephan2307, Jun 2, 2011 IP
  4. RonBrown

    RonBrown Well-Known Member

    Messages:
    934
    Likes Received:
    55
    Best Answers:
    4
    Trophy Points:
    105
    #4
    Do you mean it takes 1 minute from when you click the button to send the email to the time the page processes it and says it's been sent, or it takes 1 minute from when you click "send" to when it arrives where it has being sent to? Is it being sent to a local address on an email server or an external address at another location?

    What's being asked is, is exactly what is taking 1 minute? What do you mean by sent? and where is "sent"?
     
    RonBrown, Jun 2, 2011 IP
  5. stephan2307

    stephan2307 Well-Known Member

    Messages:
    1,277
    Likes Received:
    33
    Best Answers:
    7
    Trophy Points:
    150
    #5
    If you look at my script you can see that there is no button. I simply have a script which outputs time and date, sends a test email to an email address that is on a different server and finally output the date and time again. and when I compare those times it is about 1 minute +/- a few seconds
     
    stephan2307, Jun 2, 2011 IP
  6. m0nster

    m0nster Peon

    Messages:
    30
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    probably has to do with ur SMTP server, it may have it in queue and not sending till later
     
    m0nster, Jun 2, 2011 IP
  7. stardust.x7

    stardust.x7 Active Member

    Messages:
    369
    Likes Received:
    3
    Best Answers:
    1
    Trophy Points:
    90
    #7
    Seems you ahve problem with your SMTP server, thats why its on queue and processing little bit lately. It also depends on server firewall, mail scanner, memory and total account hosted on the server etc.
     
    stardust.x7, Jun 3, 2011 IP
  8. stephan2307

    stephan2307 Well-Known Member

    Messages:
    1,277
    Likes Received:
    33
    Best Answers:
    7
    Trophy Points:
    150
    #8
    ok I am a complete amateur on these things. How can I check the SMTP stuff out?

    The server is located in house and there is only some internal webbased system on it. Nothing else. So not overloaded ever.
     
    stephan2307, Jun 5, 2011 IP
  9. rockeerz

    rockeerz Active Member

    Messages:
    145
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    51
    #9
    Php Mysql java keeps hands on
     
    rockeerz, Jun 8, 2011 IP