Android中使用java mail 1.4.1的lib发邮件时出现该问题,
Could not find class 'javax.activation.DataHandler', referenced from method javax.mail.internet.MimeMessage.getDataHandler
Could not find class 'javax.activation.DataHandler', referenced from method javax.mail.internet.MimeMessage.setContent
Could not find class 'javax.activation.DataHandler', referenced from method javax.mail.internet.MimeMessage.setContent
Could not find class 'javax.activation.DataHandler', referenced from method javax.mail.internet.MimeMessage.updateHeaders
Could not find class 'javax.mail.MultipartDataSource', referenced from method javax.mail.internet.MimeMultipart.<init>
Could not find class 'javax.activation.FileDataSource', referenced from method javax.mail.internet.MimeBodyPart.attachFile
Could not find class 'javax.activation.DataHandler', referenced from method javax.mail.internet.MimeBodyPart.getDataHandler
Could not find class 'javax.activation.DataHandler', referenced from method javax.mail.internet.MimeBodyPart.setContent
Could not find class 'javax.activation.DataHandler', referenced from method javax.mail.internet.MimeBodyPart.setContent
Could not find class 'javax.activation.DataHandler', referenced from method javax.mail.internet.MimeBodyPart.updateHeaders
解决方法:
在android工程lib目录下放入additionnal.jar , activation.jar ,mail.jar
下载地址:https://code.google.com/p/javamail-android/downloads/list
下载不下来的到这里下载:http://download.csdn.net/detail/weizi4332/7054871