send email with attachment

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!
rzvika2Asked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
TimYatesCommented:
Can't you use a ByteArrayDataSource instead of FileDataSource, to wrap your attachment?
0
 
navotvCommented:
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
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
TimYatesCommented:
BTW:  ByteArrayDataSource is in the examples directory that came with javamail (apparently) ;-)
0
 
CEHJCommented:
>>• You may not collaborate on this question

?! Why not?
0
 
TimYatesCommented:
Where did you get that from?

Another window? ;-)
0
 
CEHJCommented:
No the one i posted into! It went after i posted - probably a bug ;-)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.