Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

send email with attachment

Posted on 2004-08-24
7
Medium Priority
?
204 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 500 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
Suggested Courses

824 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