当前位置: 代码迷 >> J2EE >> javamail-Transport.send====null解决办法
  详细解决方案

javamail-Transport.send====null解决办法

热度:886   发布时间:2016-04-22 00:40:18.0
javamail----Transport.send====null
javamail 代码报空指针异常
在Transport.send(mailMessage);这一行说nullpointerException……
报的这个错好蛋疼,无从考究啊,求大神!


DEBUG: setDebug: JavaMail version 1.4.5
java.lang.NullPointerException
at javax.mail.internet.MimeUtility.getEncoding(MimeUtility.java:226)
at javax.mail.internet.MimeUtility.getEncoding(MimeUtility.java:299)
at javax.mail.internet.MimeBodyPart.updateHeaders(MimeBodyPart.java:1375)
at javax.mail.internet.MimeBodyPart.updateHeaders(MimeBodyPart.java:1021)
at javax.mail.internet.MimeMultipart.updateHeaders(MimeMultipart.java:419)
at javax.mail.internet.MimeBodyPart.updateHeaders(MimeBodyPart.java:1354)
at javax.mail.internet.MimeMessage.updateHeaders(MimeMessage.java:2107)
at javax.mail.internet.MimeMessage.saveChanges(MimeMessage.java:2075)
at javax.mail.Transport.send(Transport.java:123)
at com.winy.mail.accomplish.AccomplishMailSender.sendMail(AccomplishMailSender.java:165)
at com.winy.mail.accomplish.TestAccomplishMail.main(TestAccomplishMail.java:27)


------解决方案--------------------
明显是mailMessage为null咯
  相关解决方案