File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Other JSE/JEE APIs and the fly likes Java Mail with Attachment Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "Java Mail with Attachment" Watch "Java Mail with Attachment" New topic

Java Mail with Attachment

Dave Wingate
Ranch Hand

Joined: Mar 26, 2002
Posts: 262
I'm having some trouble sending attachments that are in-memory. Has anyone else seen this problem before?

Here's the code I'm working with:

The exception I'm getting is:

javax.mail.SendFailedException: Sending failed;
nested exception is:
class javax.mail.MessagingException: IOException while sending message;
nested exception is: Bad file descriptor
at javax.mail.Transport.send0(
at javax.mail.Transport.send(

I'd really appreciate any advice ya'll have as I'm at a loss on this one.

Fun programming etcetera!
I agree. Here's the link:
subject: Java Mail with Attachment
It's not a secret anymore!