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 Attachments Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "Java Mail Attachments" Watch "Java Mail Attachments" New topic

Java Mail Attachments

Syed Hussain
Ranch Hand

Joined: Feb 06, 2001
Posts: 55
Hi, Could anyone send me the code to send Javamail attachments through Java Servlets through smtp.I would be very greatful.
Waiting in anticipation.
Ajan Balakrishnan
Ranch Hand

Joined: Jan 04, 2001
Posts: 71
If you are using JavaMail you have to use MimeMultipart , MimeBodyPart API's. The following is a sample code to send a file attachment

Let me know if this helps


[This message has been edited by Ajan Balakrishnan (edited March 05, 2001).]
Syed Hussain
Ranch Hand

Joined: Feb 06, 2001
Posts: 55
Thanks for the reply Ajan, but the problem is how do you upload the mail from the Client and store it on the Server.
I would be very greatful if you send me the code for recieving mail with attachments.I am getting a ClassDef Error.
Thanking you.
Cool Impression

Joined: Jun 26, 2001
Posts: 18
hello can anyone tell me source code to use authenticator to create my own users and send and receive mail to any one
if I have authenticator ""
how can i make user "" and send mail to others.
Usman Shah.

I agree. Here's the link:
subject: Java Mail Attachments
It's not a secret anymore!