Navigate
Home
ArticleWiki
Forum
Journal
Search
Newsletter
Links
Tech News
expertsrt.com
Welcome Guest.
Username:

Password:

Remember me

email question
Welcome, Guest. Please login or register.
September 06, 2008, 08:06:19 PM
11293 Posts in 1245 Topics by 842 Members
Latest Member: nimdakiller
Experts Round Table Network  |  Serverside Technology  |  ASP  |  email question « previous next »
Pages: [1]
Author Topic: email question  (Read 471 times)
Johnny26652

Offline Offline

Posts: 59


« on: December 04, 2006, 05:09:28 PM »

hello mentors
I have a email program in asp. I was wondering if it is possible to automatically send email using asp and access. say for eg i have a event start date and end date. i want to setmyself a remider say 2 days before the end date send me an email saying your end date is approaching? is is feasible to do ?thanks in advance
Logged

Johnny
VGR
Mentor

Offline Offline

Posts: 680



WWW
« Reply #1 on: December 05, 2006, 02:50:38 PM »

yes it is feasible ;-)
I could show you some working code, but in PHP, so let's stay on the principles I use :
I include (or execute) a standard function at every session opening (for instance), so that my stats are computed, reminders are sent, subscriptions are closed in due time, etc
you could do the same

it's a matter of keeping in your DB a table "status" with the "last execution date" (YYYY-MM-DD) which is usually either yesterday or today.
If that date (read once persession, so no big time loss anyway) is <> (different) from today's date (your equivalent of date('Y-M-d') then execute atomically (or not) :
- kind-of lock status table
- execution of daily tasks
- update status table if success

You can reduce this into : (if you like low risks ;-)
- update status table anyway (this "locks out" other attempts that day)
- execution of daily tasks

the same principle applies to my monthly or yearly tasks (mainly stats aggregation)
Logged

techie overlord, answers all kind of questions on http://www.europeanexperts.org
GrandSchtroumpf
Mentor

Offline Offline

Posts: 408



« Reply #2 on: December 05, 2006, 05:19:54 PM »

> I include (or execute) a standard function at every session opening (for instance)
That only works if you have enough traffic, i.e. at least one session per day.
A common solution is to use a cron job (or a windows task) that executes an arbitrary http request (e.g. http://www.mysite.com/dailytasks.asp).
Logged
Johnny26652

Offline Offline

Posts: 59


« Reply #3 on: December 05, 2006, 07:52:52 PM »

actually i am doing what you guys suggested. like once the page loads the page executes and check the db if that date is 20 days or something sends an email. i was wondering if there is any better way. what if no one loads the page? they should still receive the email right?
Logged

Johnny
VGR
Mentor

Offline Offline

Posts: 680



WWW
« Reply #4 on: December 07, 2006, 06:36:24 AM »

that's what the bearded red hat little thingy wrote ;-)

I agree that if you need regular execution of scripts/HTTP requests, it's better to use some kind of task scheduler. Being dissatisfied with the "AT" on windows, I designed my own. It's the "RobotOuaibe" that yu can find on www.edainworks.com, third-party tools, development section

I use it to send on a daily basis requests to compute stats on my sites, to update a database, to call netcraft/uptime, to generate a random new email signature out of my database, to parse my logfiles for extracting security alerts that are sent automatically to the ISPs etc
Logged

techie overlord, answers all kind of questions on http://www.europeanexperts.org
Pages: [1]
« previous next »
    Jump to: