Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to download JavaMail (mail.jar) and JAF (activation.jar) using maven

I want to do this tutorial https://www.tutorialspoint.com/java/java_sending_email.htm about sending emails with java and the first line of the tutorial says that I need to download JavaMail (mail.jar) and JAF (activation.jar), and I want to download those jars using maven is that possible since this popular website says that is not possible http://www.mkyong.com/maven/how-to-download-javamail-api-from-maven/ , I tried searching in the maven repository but there are too many jars with the same name

like image 493
Bill_Data23 Avatar asked Dec 24 '22 01:12

Bill_Data23


1 Answers

You simply need to add this dependency to your maven project:

<dependency>
    <groupId>com.sun.mail</groupId>
    <artifactId>javax.mail</artifactId>
    <version>1.5.6</version>
</dependency>

No need to add activation too (unless you want to use a specific version) as it is already a dependency of javax.mail such that it will be added as dependency to your project by transitivity.


You can find all the artifacts' description in the home page of the javamail project.

like image 189
Nicolas Filotto Avatar answered Apr 06 '23 00:04

Nicolas Filotto