Java Mail EOF错误(让我想想怎么谢您!)
1 我使用coremail邮箱发送邮件。(telnet 结果如下)
2 我用javamail 发邮件时,能获得对象,但一调用send之类的方法,就会包EOF错误。
获取到的 MimeMessage 对象不为空,session也不为空。
但调用:
Transport.send(mimeMsg);或
transport.sendMessage(mimeMsg,mimeMsg.getRecipients(Message.RecipientType.TO));
均报错:
javax.mail.MessagingException: [EOF]
at com.sun.mail.smtp.SMTPTransport.issueCommand(SMTPTransport.java:1481)
at com.sun.mail.smtp.SMTPTransport.issueSendCommand(SMTPTransport.java:1512)
at com.sun.mail.smtp.SMTPTransport.finishData(SMTPTransport.java:1322)
at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:637)
at com.cattsoft.oim.mail.SendEmailTokenToAdm.smtpWithToken(SendEmailTokenToAdm.jav
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.ja
at java.lang.reflect.Method.invoke(Method.java:597)
[解决办法]