This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JSP and the fly likes Sending Scheduled Emails Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Sending Scheduled Emails" Watch "Sending Scheduled Emails" New topic

Sending Scheduled Emails


Joined: Sep 16, 2002
Posts: 1
anyone has any idea on how i can do schedule emails?
i need to send emails at scheduled times, so i will store their content and time to be sent in the database.
question is: how do i check/know that it is time to start sending?
any comments/suggestions will be greatly appreciated
Jeanne Boyarsky
internet detective

Joined: May 26, 2003
Posts: 30057

This is probably better done in a servlet than a JSP. In the init method, you can start a thread that repeatedly sleeps for a certain amount of time. Every time it wakes up, the thread can check if it is time to send out the e-mail.

[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 60752

Welcome to the Ranch moomoo!
You'll find this forum a great place to seek help on JSP pages, and there aren't many rules you'll have to worry about, but one is that proper names are required. Please take a look at the JavaRanch Naming Policy and change your display name to match it.
JSP Fourm Bartender

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 60752

Jeanne is quite correct in that JSP is not a suitable technology for this feature. You might also want to consider implementing this as a stand-alone console Java application that you can run as a daemon process.
Don't get me started about those stupid light bulbs.
subject: Sending Scheduled Emails
Similar Threads
No More Messages!
JavaMail error
e-mail hits
Use of MDBs for sending EMails
How to get generated HTML