Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Unknown exception triggered by my Java Mail call

Will PittengerAug 20 2012 — edited Aug 21 2012
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
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 18 2012
Added on Aug 20 2012
5 comments
2,220 views