mimeMessage.getReceivedDate();为什么获取不到接收时间呢?打印时间空的
mimeMessage.getSentDate();可以拿到邮件的发送时间
我现在在写一个接收邮件新的程序 协议pop3 判断新邮件,以后读的时候只读新邮件的内容,不打印所有的邮件信息
我不想通过邮件的uid来判断,因为保存邮件的uid浪费空间,什么时候该删也不知道。通过uid来判断读来读去的,n*n次方
我就想通过邮件的接收时间来判断,只保存一个接收时间在本地,下次从保存时间开始读,,时间也会更新,也就是必须要拿到服务器端的邮件信息来作判断。在本地做标记没什么作用
通过邮件的发送时间来判断根本没作用,有的邮件可能到达的时间比较晚。。
我就奇怪啦,同个类两个方法,为什么接收时间就获取不到呢,哪位高手帮帮忙啊,这个新邮件问题,弄了几天了还没弄出来,项目经理要叨人啦 几乎搜遍了整个网络 网上也没什么人给出一个好的实现思路,大多说通过uid.各位大虾有什么更好的实现方式,说来参考一下,非常急:小弟在此谢过了
Q : 294810182
 Mail: [email protected]
我尝试过很多网友的方法
Flags.seen 设置为true不行
Flags.getFlags.toString() equals来判断不管是新旧
打印全是这个:javax.mail.Flags0
没有所谓的javax.mail.Flags10
javax.mail.Flags20
记录程序的最后访问时间到本记,下次判断是可以,但是有一个问题,比如我10点上去读了1次,有10封新邮件,我只读了5封,下次读的是这个时间以后的邮件,那其余的5封不是漏读了.
声明一下:服务器的邮件是拿到本地保存的,不牵涉到数据库  
只是用纯Java写一个application  但现在每次运行这个接收程序的时候会把服务器收件箱里所有的邮件都拿下来
要求是以后只读取新邮件的信息,不重读,不漏读
以下是JMail api里面对这个方法的描述
getReceivedDate
public Date getReceivedDate()
                     throws MessagingExceptionReturns the Date on this message was received. Returns null if this date cannot be obtained. 
Note that RFC 822 does not define a field for the received date. Hence only implementations that can provide this date need return a valid value. This implementation returns null. 
Specified by:
getReceivedDate in class Message
Returns:
the date this message was received 
Throws: 
MessagingExceptionpublic Date getSentDate()
                 throws MessagingExceptionReturns the value of the RFC 822 "Date" field. This is the date on which this message was sent. Returns null if this field is unavailable or its value is absent. 
This implementation uses the getHeader method to obtain the requisite header field. 
Specified by:
getSentDate in class Message
Returns:
The sent Date 
Throws: 
MessagingException以前是做域名注册这一块,这个星期过企业邮箱开发组来了,初次接触JavaMail,各位高手多多指教..能解决问题我的分数全给  晒一晒自己的实现方式...