Dependency of JavaMail.

Recently I study about JavaMail.

Actually, I was pretty confused when I used JavaMail at first. My question was “Which dependency is correct to use JavaMail?”. There are a few definitions of Maven.

№1

<dependency>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
<version>1.4.7</version>
</dependency>

№2

<dependency>
<groupId>javax.mail</groupId>
<artifactId>javax.mail-api</artifactId>
<version>1.4.7</version>
</dependency>

№3

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

I found the answer in Stack Overflow. Bill Shannon who is Spec Lead of Java EE answered it. Great!

Finally, I use the last one. The latest version of JavaMail now is 1.6.1.

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