By the way, depending on your type of application,
you should include the JavaMail dependency with scope
provided. In any
JEE compliant container like
JBoss, WebLogic, GlassFish, etc., JavaMail is part of the container's core library set. You don't need to include it in your application, in the same way you don't need to include the
Servlet API or Bean Validation API. If you're deploying on
Tomcat you probably need it as a compile time dependency (no scope necessary), if you have a standalone application you definitely need it as a compile time dependency.