Thursday 28 March 2013

[How To] - Fix javax.mail.NoSuchProviderException: No provider for smtp

At times, you may run into the above Exception even though you're absolutely sure that your sendEmail function is working normally on another project. This Exception happened to me after I updated my project to Use dedicated folder for storing libraries.

The solution in my case was pretty simple.
  1. First, you need to go to Oracle's site to download JavaMail API
  2. After that, add the mail.jar file to your Project's libraries. 
  3. Lastly, right click on your Project, choose Properties, under the Packaging section, you need to check the Package required JARs in EJB jar option.

Hope this helps! :)


  1. Affordable Hosting GreenWebby delivers turnkey web hosting solutions that are tailored to your specific needs. Our deep experience as a hosting company, has helped us create scalable hosting solutions that promise exceptional performance and unmatched value. Our web hosting service is coupled with world-class technical support and powers more than 6 million websites worldwide.

  2. Hello I am so delighted I located your blog, I really located you by mistake, while I was watching on google for something else, Anyways I am here now and could just like to say thank for a tremendous post and a all round entertaining website. Please do keep up the great work. Mr Fix Solutions Houston Tx