Solved

send email with attachment

Posted on 2004-08-24
7
198 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
How our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

 
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
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…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

740 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