Professional Web Applications Themes

Page Timeout - ASP Database

I have an asp page that opens a large sql table of email addresses and sends an email newsletter to each recipient. My problem is that the table contains over 8,000 addresses and the page times out after sending about 800 emails. I've tried using Response.Flush after every group of 25, but the page still times out. I have Server.ScriptTimeout = 9999, but if I set that number higher, it locks the remote server up and it has to be rebooted. I'm looking for any ideas on how to force a page to not timeout while looping through the email ...

  1. #1

    Default Page Timeout

    I have an asp page that opens a large sql table of email addresses and sends
    an email newsletter to each recipient. My problem is that the table contains
    over 8,000 addresses and the page times out after sending about 800 emails.

    I've tried using Response.Flush after every group of 25, but the page still
    times out. I have Server.ScriptTimeout = 9999, but if I set that number
    higher, it locks the remote server up and it has to be rebooted.

    I'm looking for any ideas on how to force a page to not timeout while
    looping through the email addresses and sending them. I plan on creating a
    SQL Stored procedure, but that is only going to help so much.

    Any ideas appreciated.


    Scott Guest

  2. #2

    Default Re: Page Timeout

    ASP is not the right tool for what you're trying to do. Can't you just port
    this to a VBS file and let it run - possibly as a scheduled task? Or, if
    you want it to be web-based, you can put the code in a vbs file,
    C:\file.vbs, and then run code such as:


    <%
    If Request.ServerVariables("HTTP_METHOD") = "POST" Then
    Set oShell = CreateObject("WScript.Shell")
    oShell.Run "C:\file.vbs", 0, FALSE ''don't wait for completion
    Set oShell = Nothing
    Response.Write "fine"
    End If
    %>
    <form method="post>Click to start e-mail script<input type="submit"></form>

    Ray at home


    "Scott" <com> wrote in message
    news:phx.gbl... 


    Ray Guest

  3. #3

    Default Re: Page Timeout

    Scott wrote: 

    Just to expand on Ray's advice, see the articles in aspfaq about this:
    http://www.aspfaq.com/show.asp?id=2291
    http://www.aspfaq.com/show.asp?id=2143

    --
    Microsoft MVP - ASP/ASP.NET
    Please reply to the newsgroup. This email account is my spam trap so I
    don't check it very often. If you must reply off-line, then remove the
    "NO SPAM"


    Bob Guest

  4. #4

    Default Re: Page Timeout

    Thank you both. The most important thing you did was to stop me from wasting
    time trying to do tricks with ASP. I will look over vbs method.

    One question, do you know if using SQL Mail would suffer from the same
    timing out?


    "Bob Barrows [MVP]" <SPAMcom> wrote in message
    news:phx.gbl... 
    >
    > Just to expand on Ray's advice, see the articles in aspfaq about this:
    > http://www.aspfaq.com/show.asp?id=2291
    > http://www.aspfaq.com/show.asp?id=2143
    >
    > --
    > Microsoft MVP - ASP/ASP.NET
    > Please reply to the newsgroup. This email account is my spam trap so I
    > don't check it very often. If you must reply off-line, then remove the
    > "NO SPAM"
    >[/ref]


    Scott Guest

  5. #5

    Default Re: Page Timeout

    No, as long as you didn't attempt to use it synchronously from asp.
    Asynchronous execution is the key.

    Bob Barrows

    Scott wrote: 
    >>
    >> Just to expand on Ray's advice, see the articles in aspfaq about
    >> this: http://www.aspfaq.com/show.asp?id=2291
    >> http://www.aspfaq.com/show.asp?id=2143
    >>
    >> --
    >> Microsoft MVP - ASP/ASP.NET
    >> Please reply to the newsgroup. This email account is my spam trap so
    >> I don't check it very often. If you must reply off-line, then remove
    >> the "NO SPAM"[/ref][/ref]

    --
    Microsoft MVP - ASP/ASP.NET
    Please reply to the newsgroup. This email account is my spam trap so I
    don't check it very often. If you must reply off-line, then remove the
    "NO SPAM"


    Bob Guest

  6. #6

    Default Re: Page Timeout

    one last question, (i know this is a sql question, but ask anyway).

    i know sqlmail can run using exchange, but can sql use SMTP located on same
    machine?


    "Bob Barrows [MVP]" <SPAMcom> wrote in message
    news:phx.gbl... [/ref]
    >
    > --
    > Microsoft MVP - ASP/ASP.NET
    > Please reply to the newsgroup. This email account is my spam trap so I
    > don't check it very often. If you must reply off-line, then remove the
    > "NO SPAM"
    >[/ref]


    Scott Guest

  7. #7

    Default Re: Page Timeout

    SQLMail can't (MAPI only), but XPSMTP can. There's an article about this at
    aspfaq. You can also find it via Google.

    Bob Barrows
    Scott wrote: 
    >>
    >> --
    >> Microsoft MVP - ASP/ASP.NET
    >> Please reply to the newsgroup. This email account is my spam trap so
    >> I don't check it very often. If you must reply off-line, then remove
    >> the "NO SPAM"[/ref][/ref]

    --
    Microsoft MVP - ASP/ASP.NET
    Please reply to the newsgroup. This email account is my spam trap so I
    don't check it very often. If you must reply off-line, then remove the
    "NO SPAM"


    Bob Guest

  8. #8

    Default Re: Page Timeout

    i need to understand about the WSH/VBS method. I looked over articles, but
    didn't understand where I would fetch the emails from sql and then feed them
    to the functions.

    This method also seems problematic when considering i'm trying to allow a
    user choices from a send mail asp form that will have options like which
    products he'd like to advertise in the email.


    "Bob Barrows [MVP]" <SPAMcom> wrote in message
    news:ek59P$phx.gbl... [/ref]
    >
    > --
    > Microsoft MVP - ASP/ASP.NET
    > Please reply to the newsgroup. This email account is my spam trap so I
    > don't check it very often. If you must reply off-line, then remove the
    > "NO SPAM"
    >[/ref]


    Scott Guest

  9. #9

    Default Re: Page Timeout

    Scott wrote: 

    I really can't provide more information beyond the articles which are pretty
    explicit. Have you downloaded and installed XPSMTP? The Readme page is
    pretty comprehensive. It's got examples showing how to send emails.
     

    I can't help you here. You need to work on getting the xp_smtp procedure
    working before you start thinking about anything else. Doing this will help
    you realize what you need to do about the email content.

    --
    Microsoft MVP - ASP/ASP.NET
    Please reply to the newsgroup. This email account is my spam trap so I
    don't check it very often. If you must reply off-line, then remove the
    "NO SPAM"


    Bob Guest

  10. #10

    Default Re: Page Timeout

    you misread me, i just asked about the WSH/VBS method. You don't have to be
    specific, but i'd just like to know where in the process of scheduling (or
    what file) will i grab the list of emails from sql?

    i can only guess it'd be inside the vbs file?

    i probably will use the xpsmtp method. i'm in middle of setting up my server
    and will test soon as i get it up.



    "Bob Barrows [MVP]" <SPAMcom> wrote in message
    news:phx.gbl... 
    >
    > I really can't provide more information beyond the articles which are
    > pretty explicit. Have you downloaded and installed XPSMTP? The Readme page
    > is pretty comprehensive. It's got examples showing how to send emails.

    >
    > I can't help you here. You need to work on getting the xp_smtp procedure
    > working before you start thinking about anything else. Doing this will
    > help you realize what you need to do about the email content.
    >
    > --
    > Microsoft MVP - ASP/ASP.NET
    > Please reply to the newsgroup. This email account is my spam trap so I
    > don't check it very often. If you must reply off-line, then remove the
    > "NO SPAM"
    >[/ref]


    Scott Guest

Similar Threads

  1. #40750 [NEW]: fsockopen timeout parameter overwrites timeout for reading
    By andreas dot rieber at 2e-systems dot com in forum PHP Bugs
    Replies: 14
    Last Post: March 14th, 07:22 PM
  2. cfquery, timeout attribute and cfserver timeout setting
    By Telix in forum Coldfusion - Advanced Techniques
    Replies: 1
    Last Post: July 1st, 03:42 PM
  3. Replies: 3
    Last Post: April 29th, 02:21 AM
  4. Replies: 0
    Last Post: August 7th, 12:52 PM
  5. Replies: 1
    Last Post: July 8th, 07:07 AM

Bookmarks

Posting Permissions

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

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 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139