Send e-mails from Servlets/JSP by JavaMail API / Free source code example for how to send e-mails at the scheduled time
Example for how to send e-mails from Servlets/JSP by JavaMail API. Servlet can send e-mails at the scheduled time. By multipart/form-data, you can upload files by Servlet and attache them to e-mails.
The e-mails will be queued into SQL table through Object Serialization. The users can specify when the Servlets/JSP will send e-mails. The available TimeZones can be listed and the users can select the favorite TimeZone. At the scheduled time, the back-ground Thread will select e-mails and send them to the SMPT server.
This page lists the free source code examples and the Java APIs related with JavaMail API.
|
 |
: Product by OOP-Research |
 |
: Documentation written by OOP-Research |
 |
: Patch for the other vendor's system |
How to send e-mail from Servlet / JSP with JavaMail API. You can upload files by multipart/form-data and attache them to the e-mail. You can send e-mails at the scheduled time.
When you specify when the e-mail will be sent, the available TimeZones will be listed and you can select the favorite Time Zone among them.
The e-mail is stored into the SQL table by the Object Serialization.
Once the e-mail is queued, the back-ground Thread will select it at the scheduled time and send it.
OOP MailScheduler is the Java API for your JSP / Servlets on Apache Tomcat to use JavaMail API more efficiently.
By its easy-programming interface, a few lines of code are enough for your JSP or Servlets on Apache Tomcat to send the e-mail at the scheduled time in the future.
And even if you'd like to send the e-mails immediately from JSP/Servlets on Apache Tomcat, this Java API makes your JSP/Servlets truly Thread Safe. For example, when your JSP/Servlets send the e-mails, you might experience the over-head due to the slow response from SMTP server. Yes, your JSP/Servlets cannot send their response to the browser until the SMTP server sends its response. This over-head may be apparent when the multiple requests arrive in your JSP/Servlets concurrently. Moreover, the number of connections to the SMTP server may exceeds the maximum number to be allowed. In this situation, some request to your JSP/Servlets may fail to send the e-mails:
But, don't worry. Voilà, OOP MailScheduler!
OOP MailScheduler takes over all your tedious tasks required for scheduling the e-mails:
Through MailScheduler, the e-mails (which are represented by SmtpMessage) can be sent sequentially even if the multiple requests arrive in your JSP/Servlets concurrently. And your JSP/Servlets on Apache Tomcat can send their response back to the web browser immediately, without waiting for the response from the SMTP server.
In these days, a large number of the mobile phones are shipped with the digital cameras, i.e. the users can take the pictures by their mobile phones and send them to their friends by the e-mails.
And, by OOP Pop3Receiver API, you can take the advantage of this feature.
It is the Java API for connecting to the POP3 servers through JavaMail API, and you can extract the file attachment from the received e-mail.
|
|
Caution!
|
All the APIs for Servlet/JSP introduced by this web site are now included in Bento framework:
- Simpler than JSTL or Apache Struts
- MVC framework by HTML
- Input validation from CGI FORM
- Easy user authentication
- Easy localization (L10n)
To download the APIs and source code examples, please visit the web site of Bento framework.
|
|