File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes Automatic sending of email Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Automatic sending of email" Watch "Automatic sending of email" New topic

Automatic sending of email

Ådne Brunborg
Ranch Hand

Joined: Aug 05, 2005
Posts: 208
In my current project, there is a method for automatic sending of email messages. I need to expand this method to attach a file, and there is no "addAttachment" method on javax.mail.Message or javax.mail.internet.MimeMessage

Entia non sunt multiplicanda praeter necessitatem
Paul Sturrock

Joined: Apr 14, 2004
Posts: 10336

Mime messages are made up of parts, so you don't add an attachement to the message, rather you create a part that is a file. For example:

[ November 15, 2006: Message edited by: Paul Sturrock ]

JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Ådne Brunborg
Ranch Hand

Joined: Aug 05, 2005
Posts: 208
Thank you
I agree. Here's the link:
subject: Automatic sending of email
It's not a secret anymore!