Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > How to send an email with an attachment?

Reply
Thread Tools

How to send an email with an attachment?

 
 
yihan
Guest
Posts: n/a
 
      11-10-2004
Hello,
I want to send a email with an attachment using Javamail. Can anybody help
me?
Thank you.

zhao


 
Reply With Quote
 
 
 
 
Chris Smith
Guest
Posts: n/a
 
      11-10-2004
yihan wrote:
> 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
 
Reply With Quote
 
 
 
 
Andy Flowers
Guest
Posts: n/a
 
      11-10-2004
Take a look at
http://java.sun.com/developer/online.../contents.html

"yihan" <(E-Mail Removed)> wrote in message
news:cmtasl$4ho$(E-Mail Removed)...
> Hello,
> I want to send a email with an attachment using Javamail. Can anybody help
> me?
> Thank you.
>
> zhao
>



 
Reply With Quote
 
Thomas Weidenfeller
Guest
Posts: n/a
 
      11-10-2004
yihan wrote:
> 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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
which email module - MIME::LITE, Email::Send, other? brewsterbear@googlemail.com Perl Misc 2 01-05-2007 09:45 AM
How to have email form send email and start file download bmurphy@xlrotor.com Javascript 13 05-14-2006 06:27 PM
Cannot compose ,reply or send email on Sasktel email system pcbutts1 Computer Support 5 07-29-2005 06:13 AM
why cant i send email messages from this email Billie Jo Ames Computer Support 8 06-30-2005 12:24 PM
HowTo:? open email client to send email Peter ASP .Net 0 07-01-2003 04:58 PM



Advertisments