package javax.mail and javax.mail.internet do not exist
Download javax.mail.jar
and add it to your project using the following steps:
- Extract the mail.jar file
- Right click the project node (JavaMail), click Properties to change properties of the project
- Now go to Libraries Tab
- Click on Add JAR/Folder Button. A window opens up.
- Browse to the location where you have unzipped your Mail.jar
- Press ok
- 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.