5 Replies Latest reply: Aug 21, 2012 3:55 AM by Will Pittenger RSS

    Unknown exception triggered by my Java Mail call

    Will Pittenger
      I don't know if there is a Java Mail specific forum or not, so I put this here.

      I'm getting an IOException when I attempt to send my message. Below is the full text I see. If you understand what I'm doing wrong, please let me know. The code it attempting to send a multipart MIME message. It has a body which is "See attached file(s).\n.". I also attached a small text file. Finally, since this was just going to be a test e-mail, I added myself as a recipient.

      DATA
      354 Enter mail, end with "." on a line by itself
      java.io.IOException: No content
      at javax.mail.internet.MimePartDataSource.getInputStream(MimePartDataSource.java:106)
      at javax.activation.DataHandler.writeTo(DataHandler.java:304)
      at javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:1350)
      at javax.mail.internet.MimeMessage.writeTo(MimeMessage.java:1683)
      at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:585)
      at javax.mail.Transport.send0(Transport.java:169)
      at javax.mail.Transport.send(Transport.java:98)
      at m3.main(m3.java:518)
      Exception of type class javax.mail.MessagingException
      javax.mail.MessagingException: IOException while sending message;
      nested exception is:
      java.io.IOException: No content
      at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:625)
      at javax.mail.Transport.send0(Transport.java:169)
      at javax.mail.Transport.send(Transport.java:98)
      at m3.main(m3.java:518)
      Caused by: java.io.IOException: No content
      at javax.mail.internet.MimePartDataSource.getInputStream(MimePartDataSource.java:106)
      at javax.activation.DataHandler.writeTo(DataHandler.java:304)
      at javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:1350)
      at javax.mail.internet.MimeMessage.writeTo(MimeMessage.java:1683)
      at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:585)
      ... 3 more