Selenium WebDriver Java Framework Course Limited Time Offer for $20

Selenium WebDriver Java Framework Course Limited Time Offer for $20

 

Print

Send Email With Apache Commons Email In Java

Apache Commons Email library provides a API for sending email. Using the library, users can send email with different formats.

 

Here are some common classes to use: 

  • SimpleEmail
  • MultiPartEmail
  • HtmlEmail
  • ImageHtmlEmail
  • EmailAttachment

To use the libary, you need to add the following dependency in your maven based Java project pom.xml file. 

<dependency>
     <groupId>org.apache.commons</groupId>
     <artifactId>commons-email</artifactId>
     <version>1.4</version>
</dependency>
<dependency>
    <groupId>org.apache.commons</groupId>
    <artifactId>commons-parent</artifactId>
    <version>38</version>  
</dependency>