You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-user@james.apache.org by daijun <16...@qq.com> on 2012/11/02 04:52:41 UTC

cannot get message's date

I'm trying to get a message's date. 
 But both getSenderDate() and getReceivedDate() are null.
 My code is as below:
       Store store = session.getStore();
      store.connect();
      Folder root = store.getDefaultFolder();
      Folder inbox = root.getFolder("inbox");
      inbox.open(Folder.READ_WRITE);
      Message[] msgs = inbox.getMessages();
      I can getFrom and getContent... but when I was trying to get date by:
       msgs[i].getSentDate()
      msg[i].getReceivedDate()
       I got null. 
       How can I get the message's date?
  
 Thank you in advance.
 Best Regards
  
 D. J.

Re: cannot get message's date

Posted by Ioan Eugen Stan <st...@gmail.com>.
Hello,

It looks to me like the code is from java mail. So better try asking
on the java-mail list or try using mime4j for parsing:
http://james.apache.org/mime4j/usage.html

Good luck,

On Fri, Nov 2, 2012 at 5:52 AM, daijun <16...@qq.com> wrote:
> I'm trying to get a message's date.
>  But both getSenderDate() and getReceivedDate() are null.
>  My code is as below:
>        Store store = session.getStore();
>       store.connect();
>       Folder root = store.getDefaultFolder();
>       Folder inbox = root.getFolder("inbox");
>       inbox.open(Folder.READ_WRITE);
>       Message[] msgs = inbox.getMessages();
>       I can getFrom and getContent... but when I was trying to get date by:
>        msgs[i].getSentDate()
>       msg[i].getReceivedDate()
>        I got null.
>        How can I get the message's date?
>
>  Thank you in advance.
>  Best Regards
>
>  D. J.



-- 
Ioan Eugen Stan / CTO / http://axemblr.com

---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org