Introduction to Apache Commons Email API

In this article we are going learn about how compose and send emails using apache commons api in java.
Commons Email api is designed by apache used for sending email. It is designed on top of the Java Mail APIand simplifies email operations.
Some of the important classes are listed below :
SimpleEmail - It is used for sending basic text based emails.
MultiPartEmail- It is used to send multipart messages. Like text message with attachments either inline or attached.
HtmlEmail - It is used to send HTML formatted emails. It supports both MultiPartEmail allowing attachments and embedded images.
ImageHtmlEmail - It is used to send HTML formatted emails with images.
EmailAttachment - It is a container class used for easy handling of attachments.
It is for use with instances of MultiPartEmail and HtmlEmail.
For environment setup , first we need to download commons-email-1.3.2.jar and mail.jar file and set it in to class path.
Click here to download apache commons email jars.
SHARE

    Blogger Comment
    Facebook Comment

0 comments :

Post a Comment