You can read the file and put it in a String after this set the content to
the string.
for example:
private void settextArea()
{
try{
String Testo="";
String strNomeFile=JTxtIndFile.getText();
BufferedReader in = new BufferedReader(new
FileReader(strNomeFile));
int i=0;
String Riga=new String();
for(;;)
{
i++;
Riga=in.readLine();
if(Riga==null)
{
in.close();
break;
}
Testo=Testo+Riga+"\n";
}
}
catch (java.io.FileNotFoundException FnfEx)
{
System.out.println("File non trovato" +
FnfEx.toString());
}
catch (java.io.IOException Ioex)
{
System.out.println("File non trovato" +
Ioex.toString());
}
}
..
private void SendMailMail()
{
try{
.....
message.setContent(Testo,"text/plain");// inserire contenuto
Transport.send(message,address);
......
}catch(Exception e) {
It's work fine if you use tx file.
Regards RInaldo
[EMAIL PROTECTED]
-----Messaggio originale-----
Da: A mailing list for discussion about Sun Microsystem's Java Servlet
API Technology. [mailto:[EMAIL PROTECTED]]Per conto di G S
Sundar
Inviato: mercoledi 28 marzo 2001 7.38
A: [EMAIL PROTECTED]
Oggetto: Javamail in servelts - Doubt.
Hello All,
I don't want to send the attachment as a file(I'm going to send always
text messages) i just want to send the content. I would like to write
the content in the mail itself.
Pls send your suggestions ASAP.
Thanx in advance..
Cheerz
G S Sundaram
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html