package javax.mail and javax.mail.internet do not exist package javax.mail and javax.mail.internet do not exist java java

package javax.mail and javax.mail.internet do not exist


You need to download the JavaMail API, and put the relevant jar files in your classpath.


Download javax.mail.jar and add it to your project using the following steps:

  1. Extract the mail.jar file
  2. Right click the project node (JavaMail), click Properties to change properties of the project
  3. Now go to Libraries Tab
  4. Click on Add JAR/Folder Button. A window opens up.
  5. Browse to the location where you have unzipped your Mail.jar
  6. Press ok
  7. Compile your program to check whether the JAR files have been successfully included


If using maven, just add to your pom.xml:

<dependency>    <groupId>javax.mail</groupId>    <artifactId>mail</artifactId>    <version>1.5.0-b01</version></dependency>

Of course, you need to check the current version.