Link to home
Start Free TrialLog in
Avatar of rzvika2
rzvika2

asked on

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!
Avatar of TimYates
TimYates
Flag of United Kingdom of Great Britain and Northern Ireland image

Can't you use a ByteArrayDataSource instead of FileDataSource, to wrap your attachment?
ASKER CERTIFIED SOLUTION
Avatar of TimYates
TimYates
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of navotv
navotv

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
BTW:  ByteArrayDataSource is in the examples directory that came with javamail (apparently) ;-)
>>• You may not collaborate on this question

?! Why not?
Where did you get that from?

Another window? ;-)
No the one i posted into! It went after i posted - probably a bug ;-)