Problem when including JavaMail in the Netbean

1

Download the JavaMail library and include it in my project first by creating it in the Netbeans and then adding it to the project, but when I am going to create the mail sending function it does not recognize some libraries. These are what Netbeans recognizes me:

 import org.springframework.mail.MailException;
 import org.springframework.mail.javamail.JavaMailSender;
 import org.springframework.mail.javamail.MimeMessagePreparator;

And these are the ones that do not:

import javax.mail.Message;
import javax.mail.MessagingException;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeMessage;

When I check email it does not exist inside javax. It seemed to me that I was wrongly including the library to the project but I did a search of how it is done and apparently it was doing well.

    
asked by Omar Miranda 31.03.2017 в 22:39
source

1 answer

1

Sometimes we have problems because we are not including the correct files in our library.

In the case of JavaMail there have been recent changes, as indicated by Oracle in this regard:

  

The open source JavaMail project has moved to java.net, where you can   download the latest release binaries, sample code, source code, etc.   The source code for the JavaMail API Reference Implementation is also   available in the Mercurial repository at the JavaMail project on   java.net   

  The JavaMail project has been moved to java.net, where you can download the latest offered binaries, sample code, source code, etc. The source code for the JavaMail API Reference Implementation is also available in the Mercurial repository in the JavaMail project on the java.net website.

This means that currently the updated libraries for JavaMail to run smoothly are in the Java.net page dedicated to the JavaMail project . If you download the libraries from there and add them to your project, you should not have any problems.

    
answered by 03.04.2017 / 15:47
source