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
Solved

send email with attachment

Posted on 2004-08-24
7
197 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

Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
netstat -ano | find "8000" and taskkill /f /pid 2984 3 83
windows explorer path to command prompt 5 54
table example 4 32
servlet example 11 49
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…
I had a project requirement for a displaying a user workbench .This workbench would consist multiple data grids .In each grid the user will be able to see a large number of data. These data grids should allow the user to 1. Sort 2. Export the …
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:
The viewer will learn how to implement Singleton Design Pattern in Java.

809 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