• Triggering events?

    Author
    Topic
    #378745

    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?

    Viewing 0 reply threads
    Author
    Replies
    • #627944

      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! smile

      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!

      • #628026

        Great theory! Now for the details! grin

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

        • #628044

          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!

          • #628140

            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…

            • #628147

              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:

              (spaces added to prevent messing up the display on the lounge)

              Hope this helps!

            • #628149

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

    Viewing 0 reply threads
    Reply To: Triggering events?

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: