Today we will share code how to send any type of selenium report in mail using java. For sending the email using JavaMail API, you need to load the two jar files: mail.jar activation.jar package SeleniumNew; import java.util.Properties; import javax.activation.DataHandler; import javax.activation.DataSource; import javax.activation.FileDataSource; import javax.mail.*; import javax.mail.internet.*; public class SendEmail { public static void main(String[] args) { String host="smtp.gmail.com"; final String user="ashishxx@gmail.com";//change accordingly final String password="XXX";//change accordingly /*String[] to={"AshishXX@gmail.com","Ashishxxx@gmail.com"}; String[] cc={}; String[] bcc={}; */ String to="ashishxx@gmail.com";//change accordingly //Get the session object Properties props = new