• GoDaddy Community
  • Website Design & Development
  • Website Design & Development

    cancel
    Showing results for 
    Show  only  | Search instead for 
    Did you mean: 
    Go to solution
    New

    Using PHP mailer to send email after download ... one email is instant, other takes 20 mins ... why?

    I'm developing a download page ... user fills in a form, clicks submit, an email goes to me@mydomain.com and it arrives instantly.  Another email goes to the customer at the customer's email address notme@gmail.com ... the email to the customer arrives 10-to-20 minutes later.  Why isn't the customer's email also instant?  

     

    For best customer experience I need the email to arrive as quickly as possible instead of making them wonder if they did something wrong for 20 minutes.

     

    Here's my code ... email to me@mydomain.com ...

     

    require 'mailer/PHPMailerAutoload.php';
    $mail = new PHPMailer;
    //$mail->SMTPDebug = 3;                               // Enable verbose debug output
    //$mail->isSMTP();                                      // Set mailer to use SMTP
    $mail->Host = 'a2plcpnl0081.prod.iad2.secureserver.net';  // Specify main and backup SMTP servers
    $mail->SMTPAuth = true;                               // Enable SMTP authentication
    //Username to use for SMTP authentication
    $mail->Username = 'me@mydomain.com';
    //Password to use for SMTP authentication
    $mail->Password = 'mypassword';
    //ssl or my password
    $mail->SMTPSecure = 'ssl';  
    //Set the SMTP port number - likely to be 25, 465 or 587
    $mail->Port = 465;                                
    //Set who the message is to be sent from - same with Username
    $mail->setFrom('me@mydomain.com', 'mydomain.com support');
    //Set who the message is to be sent to
    $mail->addAddress('me@mydomain.com');
    // Reply email
    $mail->addReplyTo($_POST['email']);
    $mail->isHTML(true);                                  // Set email format to HTML
    $mail->Subject = 'There was a Download at mydomain.com!';
    $mail->Body    = "contents of the email to me";
    $mail->send();

     

    And here is the code that sends email to the customer ...

     

    $mail = new PHPMailer;
    //$mail->SMTPDebug = 3;                               // Enable verbose debug output
    //$mail->isSMTP();                                      // Set mailer to use SMTP
    $mail->Host = 'a2plcpnl0081.prod.iad2.secureserver.net';  // Specify main and backup SMTP servers
    $mail->SMTPAuth = true;                               // Enable SMTP authentication
    //Username to use for SMTP authentication
    $mail->Username = 'me@mydomain.com';
    //Password to use for SMTP authentication
    $mail->Password = 'mypassword';
    //ssl or tls
    $mail->SMTPSecure = 'ssl';  
    //Set the SMTP port number - likely to be 25, 465 or 587
    $mail->Port = 465;                                
    //Set who the message is to be sent from - same with Username
    $mail->setFrom('me@mydomain.com', 'Mydomain.com Support');
    //Set who the message is to be sent to;  using a test email address notme@gmail.com
    $mail->addAddress($_POST['email']);
    // Reply email
    $mail->addReplyTo('me@mydomain.com');
    $mail->isHTML(true);                                  // Set email format to HTML
    $mail->Subject = "Thank you for downloading";
    $mail->Body    = "Thank you for downloading";

    $mail->send();

     

    1 ACCEPTED SOLUTION
    New

    Following up on my problem.

     

    I just had a long chat with a godaddy support guy and he looked into it.

     

    It turns out that web hosting plans on a shared server means emails are sent in a shared queue and sometimes the queue can take a while to send.  Sometimes it's fast, sometimes there's a wait.

     

    Ideally I'd like my customers to get their email immediately so they don't think they've done something wrong, so a long 20 minute wait is not great for me.

     

    I asked in their Outlook365 "professional" email would eliminate this delay problem, and it will not.

     

    He did say that I should consider moving my content to a non-shared server ... I have not looking into that yet, but he provided me this URL which is supposed to have some info about that.

     

    I will likely research other email sending alternatives ... a quick google search shows there are a variety of 3rd party services that specialize in this sort of thing.

     

     

    View solution in original post

    1 REPLY 1
    New

    Following up on my problem.

     

    I just had a long chat with a godaddy support guy and he looked into it.

     

    It turns out that web hosting plans on a shared server means emails are sent in a shared queue and sometimes the queue can take a while to send.  Sometimes it's fast, sometimes there's a wait.

     

    Ideally I'd like my customers to get their email immediately so they don't think they've done something wrong, so a long 20 minute wait is not great for me.

     

    I asked in their Outlook365 "professional" email would eliminate this delay problem, and it will not.

     

    He did say that I should consider moving my content to a non-shared server ... I have not looking into that yet, but he provided me this URL which is supposed to have some info about that.

     

    I will likely research other email sending alternatives ... a quick google search shows there are a variety of 3rd party services that specialize in this sort of thing.

     

     

    View solution in original post