dcsimg
Exception when reading "text/plain" content
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   cougar_six
Posted On:   Wednesday, December 11, 2002 06:02 AM

hi folks i have a problem when reading out the content of "text/plain" messages, maybe its quite simle i have a MimeMessage msg which is has the content text/plain when i call: msg.getContent(); i get this exception: java.io.IOException: No content at com.sun.mail.imap.IMAPInputStream.fill(IMAPInputStream.java:83) at com.sun.mail.imap.IMAPInputStream.read(IMAPInputStream.java:130) at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(StreamDecoder.java:404) at sun.nio.cs.StreamDecoder$CharsetSD.implRead(StreamDecoder.java:442) at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:179) at java.io.InputStreamReader.r   More>>

hi folks

i have a problem when reading out the content of "text/plain" messages, maybe its quite simle


i have a MimeMessage msg which is has the content text/plain

when i call: msg.getContent();


i get this exception:

java.io.IOException: No content

at com.sun.mail.imap.IMAPInputStream.fill(IMAPInputStream.java:83)

at com.sun.mail.imap.IMAPInputStream.read(IMAPInputStream.java:130)

at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(StreamDecoder.java:404)

at sun.nio.cs.StreamDecoder$CharsetSD.implRead(StreamDecoder.java:442)

at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:179)

at java.io.InputStreamReader.read(InputStreamReader.java:167)

at com.sun.mail.handlers.text_plain.getContent(text_plain.java:81)

at javax.activation.DataSourceDataContentHandler.getContent(DataHandler.java:745)

at javax.activation.DataHandler.getContent(DataHandler.java:501)

at javax.mail.internet.MimeMessage.getContent(MimeMessage.java:1332)

at mail.readMessage(mail.java:102)

at mail.main(mail.java:112)

Exception in thread "main"



maybe someone can help me



thanks in advance




cougar

   <<Less

Re: Exception when reading "text/plain" content

Posted By:   ravikant_mohite  
Posted On:   Saturday, December 14, 2002 07:42 AM

Hi
Try this



String msg = "Hi i am new to java mail";

message.setContent(msg,"text/plain");

message.setHeader("Content-Type", "text/html");

Transport.send(message);



thanks

About | Sitemap | Contact