I am making a email sending application in android phone. For that I included two jar file activation. jar
and mail.jar
. But when I run this application and try to send the mail, I got following error on LogCat
.
java.lang.NoClassDefFoundError: javax.activation.DataHandler
I am new to android. so I am not able to figure out this issue. please Help me. Thanks
The JavaMail API Reference Implementation version 1.5.5 and later have built in support for Android and include support for OAuth2.
Per the documentation:
Starting with JavaMail 1.6.0:
There is an Android-friendly port of javamail which you should be using. There are three libraries that you need to include in your app: mail.jar, activation.jar, and additionnal.jar(sic). It looks like you are missing something that the activation library depends on, and this could be because you are not using the Android port of this library.
I have used the Android-friendly version of javamail successfully in a project, and it works really well.