If I use "MimeMessage.setContent(String body, String charset)"!_NEWLINE_!how can I attach a file?
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Gabriele_Memmi
Posted On:   Tuesday, April 23, 2002 08:36 AM

Hi,I have to set the charset and I used the following code: MimeMessage.setContent(body, "text/plain;charset=WINDOWS-1252"); On the other side if I use Multipart class (see code below) I'm not able to set the charset. Who can help me? Thanks in advance. DataSource source = new FileDataSource(filename); BodyPart messageBodyPart = new MimeBodyPart(); messageBodyPart.setDataHandler(new DataHandler(source)); messageBodyPart.setFileName(filename); Multipart multipart = new MimeMultipart(); multipart.addBodyPart(messageBodyPart); message.setCo   More>>

Hi,I have to set the charset and I used the following code:




MimeMessage.setContent(body, "text/plain;charset=WINDOWS-1252");





On the other side if I use Multipart class (see code below)

I'm not able to set the charset.

Who can help me?

Thanks in advance.







DataSource source = new FileDataSource(filename);

BodyPart messageBodyPart = new MimeBodyPart();

messageBodyPart.setDataHandler(new DataHandler(source));

messageBodyPart.setFileName(filename);

Multipart multipart = new MimeMultipart();

multipart.addBodyPart(messageBodyPart);

message.setContent(multipart);

   <<Less
About | Sitemap | Contact