OOP-ResearchMake It Simpler by Object Oriented Programming

OOP SmtpSender API: How to send e-mails from JSP/Servlet through JavaMail API

Java API to send e-mails from JSP/Servlet through JavaMail API. JSP/Servlet can attach the file to e-mails.

Related Pages:


How to send e-mails from JSP/Servlet through JavaMail API...

With this Java API, your JSP/Servlet can easily send the e-mails through JavaMail API. For example,


   SmtpSender smtp=SmtpSender.getInstance();
   MailToBeSent send=new MailToBeSent();
   send.setSubject("Hello");
   send.setFromAddress("some@bar.com","Someone");
   send.addToAddress("another@foo.com","Anotherone");
   send.setBody("Hello, this is test!");
   smtp.sendMail(send);


If you'd like to send the e-mail with the file attachment, your source code will look like below:

   SmtpSender smtp=SmtpSender.getInstance();
   MailToBeSent send=new MailToBeSent();
   send.setSubject("Hello");
   send.setFromAddress("some@bar.com","Someone");
   send.addToAddress("another@foo.com","Anotherone");
   send.setBody("Hello, test with the file attachment!");
   byte[] bin=.....
   send.attacheFile(bin,"photo.jpg","image/jpeg");
   smtp.sendMail(send);


Anyway, your source code will not include any fragment for JavaMail API and be much simler.
Go Site Map

Download

This API is now a part of Bento framework. There are the better documentations and source code examples on the web site for Bento framework. There, you will also find the link to download the entire framework or each API in it.

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.


JBuilder 2007


General Information

For Java Development

Java and all Java-based trademarks and logos are trademarks or registered of Sun Microsystems, Inc. in the United States and other countries.


ALL CONTENTS COPYRIGHT 1997-2007, OOP-Research Corporation. All rights reserved.