Solved

send email with attachment

Posted on 2004-08-24
7
196 Views
Last Modified: 2013-11-24
Hi!
I know how to send email with attachments (where the attachment are based on phisical files)
I have a byte array that represents a file and I want to send it as attachment.
Can you show me how to do it without creating a temporary file?
Thanks!
0
Comment
Question by:rzvika2
  • 4
  • 2
7 Comments
 
LVL 35

Expert Comment

by:TimYates
ID: 11879654
Can't you use a ByteArrayDataSource instead of FileDataSource, to wrap your attachment?
0
 
LVL 35

Accepted Solution

by:
TimYates earned 125 total points
ID: 11879665
0
 

Expert Comment

by:navotv
ID: 11880110
javaWorld geting start with JavaMail it's a good article and have many examples
http://www.javaworld.com/javaworld/jw-10-2001/jw-1026-javamail.html
0
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 
LVL 35

Expert Comment

by:TimYates
ID: 11880120
BTW:  ByteArrayDataSource is in the examples directory that came with javamail (apparently) ;-)
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 11880438
>>• You may not collaborate on this question

?! Why not?
0
 
LVL 35

Expert Comment

by:TimYates
ID: 11880457
Where did you get that from?

Another window? ;-)
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 11880501
No the one i posted into! It went after i posted - probably a bug ;-)
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question