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?
![]() |
Patch reliability is unclear. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
Home » Forums » Developers, developers, developers » Web design and development » 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!
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!
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!
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…
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!
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.
Notifications