Results 1 to 2 of 2

Thread: [RESOLVED] Mail() function, taking time to load a page.

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2007
    Posts
    8

    [RESOLVED] Mail() function, taking time to load a page.

    Hi All,

    I'm working on a project, where I need to send mail to a customer, if
    1)customer registser to the site.
    2)customer places an order.

    I have used Mail() function. but it's taking too much time to load a page..
    if I comment Mail(). page is getting executed fast.

    Is there any solution, so dat using Mail() page load time can b reduced..

    below is the code for registration

    //

    <? $sndUrl = "http://".$_SERVER['HTTP_HOST']."/main/redirect.php?r=reg&u=$usrEmail";
    $emlMesg="
    <font style='font-size:11px;font-family:georgia'>
    Welcome to <B>abc.com</b>!<BR><br>
    Thank you for registering with shippingsearch.com.<BR>
    Please click the link below to continue your registration:<BR>
    <a href='$sndUrl'>$sndUrl</a> <BR><BR>
    If the above link does not work please copy the link below and paste or type it into
    your browser/navigator address window.<BR><BR>

    The e-mail address that you have registered is <a href='mailto:$usrEmail'>$usrEmail</a>.<BR><BR>

    If you have any problems with this registration process please e-mail your queries
    to <a href='mailto:[email protected]'>[email protected]</a>.
    We will complete your registration for you.<BR><BR>

    Sincere regards,<BR>
    Support Division<BR>
    ?>

    <?
    $sendto = $usrEmail;
    $ccto = "[email protected]";
    $frmEml = "[email protected]";
    $headers = "From: $frmEml\r\nCC:$ccto\r\nContent-type: text/html;charset=us-ascii";
    $subject = "Your Registration at abc.com";
    mail($sendto, $subject, $emlMesg, $headers);
    ?>
    //

    same code is for orders but with the order details..

    Please it's urgent
    Veena
    Last edited by veena das; Jan 16th, 2007 at 07:21 AM.

  2. #2
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906

    Re: [NOT RESOLVED] Mail() function, taking time to load a page.

    Are you running this script on windows or linux? It's worth remembering that if you have configured PHP to use an SMTP server, a hanging connection will cause the script to hang indefinitely.

    The only way around this is not to use the mail function. Instead store all the emails you with to send in a temporary directory and have script run as a cron job at regular intervals to send the email.
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width