How do you send email out automatically

Expert:
I have a Cold Fusion web site with a back ended SQL database. I would like to know the best way and/or approach on how to send out a notification email out automatically if no action has not been received say with 8 hours. Action could be the database was updated. Curious hope this sort of thing is usally done?
tcmmaxtAsked:
Who is Participating?
 
gdemariaCommented:

As radcaesar alludes to, the first thing you need to do is identify what it means by "no action"

Do you have a time stamp for the last action so you know when 8 hours has past?

Then you need to setup a scheduled task and run a query to select the record you want to email where there has been no action for 8 hours.   Loop each item of the query and then log the fact that you sent out an email (that will prevent you from sending many of these emails).  You can log the email by updating a column on the table  (LastEmailDate) or adding a record to a child table (this will give you a history of all emails).

Of course you need to modify your query so that both conditions are checked - WHERE there has been no activity for 8 hours and No email has been sent out for X number of hours...

0
 
radcaesarCommented:
"if no action has not been received say with 8 hours" means no updates in database for 8 hours?
0
 
Brijesh ChauhanStaff IT EngineerCommented:
You could have a column in your database named lastUpdate of type datetime. This would store the latest date information of the last action that happened.

Then you will need a SCHEDULE task to be created in CF Administrator, which would run and check the lastUpdate with the present time (NOW()), and get the timedifference in Hours. If the timedifference is Greater or Equal to 8 hours, then it will trigger an EMAIL otherwise it will abort.
0
Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

 
gdemariaCommented:

i think there's an echo in here
0
 
tcmmaxtAuthor Commented:
thank you very much. this will give me a good start
0
 
_agx_Commented:
i think there's an echo in here

Haha. There's an echo riding around on your coat tails ;-)
0
 
gdemariaCommented:

Lol, ya, just change the words around, throw in a google link sometimes ...
 
:)
0
 
_agx_Commented:
Yes, throwing words around changes them! Especially with links.  Check this:

http://dictionary.reference.com/browse/echo
http://www.merriam-webster.com/dictionary/mimicry

;)

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.