File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes automatically sent email reminder using JAVA Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "automatically sent email reminder using JAVA" Watch "automatically sent email reminder using JAVA" New topic

automatically sent email reminder using JAVA

Chuan Ren
Ranch Hand

Joined: Aug 04, 2003
Posts: 42
Hi all,
I am posting this in this section, as I am not sure if this requirement could be achieved in JSP/Servlet. Please correct me if I am wrong.
I'm developing a mini Course booking application using JSP-Servlet. One of the requirement is to automatically send out reminder to registered user with reminder of the training, say, a day prior to the training. All the information is kept in mySQL database.
Basically, I need the application to check on a daily basis (from the database) and then sent out the email.
The OS is Windows 2000 Server. Application Server is Tomcat 4.1.
I know I could use the schedular in Windows to trigger the daily check.
I'm very new to Java and not sure how to move into the next step.
Could anyone please help.
Thanks in Advance,

Joined: May 13, 2003
Posts: 5
You can set the task in winows and generate one db class which will the make connection and retrive the result and other which we will send the email and call this class from class which is registered with task.
Tom Purl
Ranch Hand

Joined: May 24, 2002
Posts: 104
It appears to me that you do know how to use Windows scheduler, but you dnon't know how to write the program to read the database and send out e-mails.
One way to access mySql using Java is the use the JDBC library. For a good basic tutorial on how to use JDBC, check out the JDBC chapter in a book called Just Java. If you want a more hands-on example, download and install the mckoiDB database engine . It's free, small, and has some great sample code that should help you get up and running. 95% of the code that you should need to complete the db-related portion of your program should be included with that application.
Now that you have the names, how are you going to e-mail them? Well, that has a lot to do with the e-mail application(s) that your company uses. There's a JavaMail library available, but it might not work in your system; check with your sysadmins to see what options are available.
Also, I wouldn't recommend creating a JSP or servlet to accomplish your tasks. A simple, standalone Java program with a public "main" method is your best choice.
[ August 07, 2003: Message edited by: Tom Purl ]

Tom Purl<br />SCJP 1.4
Sridhar Venkat

Joined: Aug 11, 2003
Posts: 13
You could use Java sockets and the SMTP protocol to send emails. Check out this link
I agree. Here's the link:
subject: automatically sent email reminder using JAVA
It's not a secret anymore!