Results 1 to 7 of 7
  1. #1
    4 Star Lounger
    Join Date
    Dec 2000
    Location
    Faifax, Virginia, USA
    Posts
    542
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Triggering events?

    I'd like to send 'reminder emails' based on dates contained in a web-based database. How do I do that?

    On un*x, there used to be a 'chron' or an 'at' command (been a while since i used those). Is that where i should be looking?

  2. #2
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    1,862
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Triggering events?

    Hi Peter,

    This sounds like a job for Windows Scripting Host, CDONTS objects, and the Windows Event Scheduler - assuming you're using a Windows host. If you're using Unix, then disregard the following! <img src=/S/smile.gif border=0 alt=smile width=15 height=15>

    You can write a Windows Scripting file (using VBScript - just like ASP) to create a message (using the CDONTS.NewMail object), then send the message to any email address with the appropriate data. If you need to include data of some kind from the database, you can simply connect to it with ADO (again, just like ASP). Finally, set the WSH file to run at the desired interval.

    Keep in mind that I haven't tried this, so it may not be quite so simple, but it sounds good in theory!

    Hope this helps!

  3. #3
    4 Star Lounger
    Join Date
    Dec 2000
    Location
    Faifax, Virginia, USA
    Posts
    542
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Triggering events?

    Great theory! Now for the details! <img src=/S/grin.gif border=0 alt=grin width=15 height=15>

    I will check with my host to see if 'At' can be included in WSH script.

  4. #4
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    1,862
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Triggering events?

    DO you men "@" or "At"???

    I should have asked to be sure, but it sounds like you're using a remote web host and not one that's under your immediate control...

    If that's the case, you could easily trigger the events to happen based on a user response from one of your ASP pages... (For example, I have several feedback forms that send an email to an individual when someone submits comments.) Otherwise, it will be difficult to set up an event to occour at a specific time or interval.

    Another possible method would be using the Global.asa file (located in your web root folder - if it's not there, you can create it) to initialize a timer based on the Application start and Application end. But, again, that would not necessarily happen witout having users on the site. I believe the Application object is similar to the Session object - it is only active when users are using it and then it times out after a certain time of inactivity.

    Oooo - the gears are turning now!! You could place a simple ASP page on your server that does the desired mail sending. However, make the ASP page require certain parameters to be sent in order to execute the mail send. Then, on your LOCAL computer set an event timer to launch the appropriate URL at the desired times! AH HA!! That might be the ticket...

    As for using the CDONTS objects, it's a LOT easier than I thought at one time. Here's a link to an explanation and code sample from MS: Send Method (CDONTS NewMail object)

    Hope this helps!

  5. #5
    4 Star Lounger
    Join Date
    Dec 2000
    Location
    Faifax, Virginia, USA
    Posts
    542
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Triggering events?

    I meant 'At', but the idea of using an event on my machine looks like one way around some obstacles...

    OTOH, several folks use the site in question as their home page, so there is always 'someone going there'. I could make the homepage run an ASP script to look at the clock and hmm ... an Application variable? ... to act and reset the trigger. But then i would have to change index.htm to index.asp, which would create too much confusion for my naive surfers who would have to change their 'Favorites', wuldn't I? Hmm...

  6. #6
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    1,862
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Triggering events?

    If they have the bookmark made to the site (or folder) root, then they won't have to worry - the change will be transparent to them. If, however, they have actually bookmarked the file name then they'll have to change.

    Actually, what you could do is put a Refresh header in the index.htm page referring them to the "default.asp" page. Like this:

    < meta http-equiv="Refresh" content="5; URL=default.asp" > (spaces added to prevent messing up the display on the lounge)

    Hope this helps!

  7. #7
    4 Star Lounger
    Join Date
    Dec 2000
    Location
    Faifax, Virginia, USA
    Posts
    542
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Triggering events?

    Interesting ideas! I need to make a copy of this thread...

Posting Permissions

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