Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Feb 2009
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation PHPMailer email taking too much time

    Dear all,
    I am using PHPmailer for sending few emails in my page. Now this page is too much time(approximately 45-50 seconds) to redirect to another page after submission. My question is that is there any ways by which i can reduce the loading time of my page. Now as far as sql queries are concerned,they are simple queries like select * from table1 where field1='No' etc and all my tables are indexed. So i think my queries are optimized. Also currently my project is in testing mode and when go live ,i can expect 100-200 emails from page. So please help me in this matter.

  • #2
    New Coder
    Join Date
    Mar 2009
    Location
    Chicago, IL
    Posts
    69
    Thanks
    0
    Thanked 15 Times in 15 Posts
    Try benchmarking your code to see where the delay is. At the beginning use:

    PHP Code:
    $time_start microtime(1); 
    Then add checkpoint array at the points you want to measure:

    PHP Code:
    $checkpoint[0] = microtime(1);
    $checkpoint[1] = microtime(1);
    // etc. 
    Then at the end show how long they took:

    PHP Code:
    foreach ($checkpoint as $k => $v)
    {
        
    $time_elapsed $v $time_start
        echo 
    "Checkpoint {$k} reached in {$time_elapsed} seconds <br>"


  • #3
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,852
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Blog Entries
    1
    Now as far as sql queries are concerned,they are simple queries like select * from table1 where field1='No' etc and all my tables are indexed.
    Do you have many queries in loop?
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)


  •  

    Posting Permissions

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