File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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 REST with Spring (video course) this week in the Spring 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
author & internet detective

Joined: May 26, 2003
Posts: 32815

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.

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63540

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] [About Bear] [Books by Bear]
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63540

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.
I agree. Here's the link:
subject: Sending Scheduled Emails
It's not a secret anymore!