Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Sending Scheduled Emails

 
moomoo
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Marshal
Posts: 34178
340
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64692
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
Thanks!
bear
JSP Fourm Bartender
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64692
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
bear
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic