0

I'am trying to send an automatic email with JavaMail on Oracle. I added external JARs on Java Build Path (mail.jar and activation.jar). I don't know what I'm doing wrong because I get this error message:

java.lang.ClassNotFoundException: javax.mail.internet.AddressException
org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1358)
org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1180)

I'm using Tomcat v8.5.

SternK
  • 11,649
  • 22
  • 32
  • 46
Lely22
  • 29
  • 4

2 Answers2

0

You should add Javax mail dependency to make it work.

Deepak
  • 171
  • 1
  • 12
0

You need to add the JavaMail library Jars either to the Tomcat lib folder, or it has to be part of your WAR file when you deploy your WebApp. Adding it to the Build Path makes it only available during compile time. Although, depending on the configuration for the Deployment, it could be deployed, too – but obviously, not in your case.

tquadrat
  • 3,033
  • 1
  • 16
  • 29