Here is working sample of javamail example to send a mail.

 * @param args input param
 * @throws Throwable throws any exception
public static void main(final String[] args) throws Throwable {
Properties propMgr = PropertyManager.load("");
 final Properties props = new Properties();
 props.setProperty("mail.transport.protocol", "smtp");
 props.setProperty("", "");
 props.setProperty("mail.user", "username");
 props.setProperty("mail.password", "password");
 final Session mailSession = Session.getDefaultInstance(props, null);
 final Transport transport = mailSession.getTransport();
 final MimeMessage message = new MimeMessage(mailSession);
 message.setSubject("HTML  mail with images");
 message.setFrom(new InternetAddress(""));
 message.setContent("Cheers,Cashyup", "text/html");
   new InternetAddress(
 transport.sendMessage(message, message

Sandeep Joshi
Mathematics, Technology and Programming are my passion. I am a part of Java Ecosystem and through this blog, I contribute to it. I am here to blog about my interests, views and experiences.
I am on Google+ and Facebook.
I feel proud to be listed as a "National Memory Record Holder" in the Limca Book of Records, 2009 and have attempted for an International Memory record in the Guiness Book of Records. I can remember the value of PI upto 10,000 digits after the decimal (3.1415.....). You can contact me on ; I would like to hear from you :)