message.getInputStream returns empty stream
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Ashok_Naidu
Posted On:   Wednesday, July 10, 2002 12:51 AM

Properties props = System.getProperties(); props.put("mail.imap.host", "192.168.1.6"); Session session1 = Session.getInstance(props, null); Store store = session1.getStore("imap"); store.connect("192.168.1.6", "userid", "password"); Folder folder = store.getFolder("INBOX"); folder.open(Folder.READ_WRITE); System.out.println("Connected"); Message msg=folder.getMessage(1); InputStream In = msg.getInputStream(); System.out.println("InputStream Size : " + In.available()); System.out.println("Part/Message Size : " + msg.getSize());    More>>
			
				
Properties props = System.getProperties();
props.put("mail.imap.host", "192.168.1.6");
Session session1 = Session.getInstance(props, null);
Store store = session1.getStore("imap");
store.connect("192.168.1.6", "userid", "password");
Folder folder = store.getFolder("INBOX");
folder.open(Folder.READ_WRITE);
System.out.println("Connected");

Message msg=folder.getMessage(1);
InputStream In = msg.getInputStream();

System.out.println("InputStream Size : " + In.available());
System.out.println("Part/Message Size : " + msg.getSize());


I am getting InputStream size as zero. If i use pop3, i get the entire content
in the stream. Is there some different way to access the mail content through
imap? Or is some problem with mail server. msg.writeTo(System.out) works fine.
But InputStream fails!! Please help    <<Less
About | Sitemap | Contact