How to send an email with an attachment?

Y

yihan

Hello,
I want to send a email with an attachment using Javamail. Can anybody help
me?
Thank you.

zhao
 
C

Chris Smith

yihan said:
Hello,
I want to send a email with an attachment using Javamail. Can anybody help
me?

Yep. You need to create a MimeMultipart object, and call addBodyPart to
add both the main message and the attachment, and then use setContent on
a message to set the MimeMultipart as the content of the message. Then
send the message as you normally would.

--
www.designacourse.com
The Easiest Way To Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation
 
T

Thomas Weidenfeller

yihan said:
Hello,
I want to send a email with an attachment using Javamail. Can anybody help
me?

You can help yourself. The JavaMail package itself comes with a bunch of
applicable examples. Go to the demo directory of your JavaMail
installation and study them.

/Thomas
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top