Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Date of email in java mail api  RSS feed

 
Maki Jav
Ranch Hand
Posts: 449
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
How to get the date email was received, using java mail api
The current code I am using is returning "null"
Here is the code
........
for (int i = 0; i < msgs.length; i++)
{
MimeMessage msg = (MimeMessage)msgs[i];
if (show)
{
try{
out.println("" + msg.getFrom()[0]);
}catch(Exception e){out.println("UNKNOWN ");}

System.out.print(msg.getReceivedDate()+" "
+msg.getMessageNumber()+" "+ msg.getSubject());
............

Thanx in Advance,

Maki Jav
 
Maki Jav
Ranch Hand
Posts: 449
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I got the solution to this problem and that is :
msg.getSentDate();
It worked both on James and Java mail server v0.992
Thanks
Maki Jav
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!