Multi- line mail body with MimeMessage.setContent()
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Alexander_Krumrein
Posted On:   Thursday, August 16, 2001 09:16 AM

Hi, there has been some discussion and answers on how to create multi-line messages, but they won't work with the setContent() method. I tried : 1. StringBuffer sB = new StringBuffer(); sB.append("Test- Mail: Sonderzeichen: AÄOÖUÜß "); sB.append("ãéëíóüCñ "); sB.append("more dynamic data "); msg.setContent(sB.toString(),"text/html;charset="iso-8859-1""); 2. String nl =System.getProperty("line.separator"); String msg = "bla bla" + nl + "äöuß" + nl    More>>

Hi,

there has been some discussion and answers on how to create
multi-line messages, but they won't work with the setContent()
method.


I tried :


1.



			
StringBuffer sB = new StringBuffer();
sB.append("Test- Mail:

Sonderzeichen: AÄOÖUÜß
");
sB.append("ãéëíóüCñ
");
sB.append("more dynamic data
");
msg.setContent(sB.toString(),"text/html;charset="iso-8859-1"");


2.



			
String nl =System.getProperty("line.separator");
String msg = "bla bla" + nl + "äöuß" + nl + "éáô";
msg.setContent(msg,"text/html;charset="iso-8859-1"");


3. (the supposed-2-B-simple-way)



			
String msg = "bla bla
äöuß
éáô";
msg.setContent(msg,"text/html;charset="iso-8859-1"");


None of the above worked.

I can't use setText() because of the charset.
Does anybody have another idea?



I have problems compiling the setContent(String message, String charset)
method from MimeMessage, because javac doesn't consider the function signature.
Is this due to an old mail.jar version?




Alex

   <<Less
About | Sitemap | Contact