dcsimg
Fetching E-Mails from POP3
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   sanjay_ratnalikar
Posted On:   Thursday, November 29, 2001 04:47 AM

I am developing a application in which one of the feature is Mail Box .I am invoking getReceivedDate() method on Message object by doing Date d = message.getReceivedDate(); i am getting the value of d as null always.I would like to know how to retrieve the received date of a mail. I am successfully retrieving sent date by invoking getSentDate() on the same Message object. I would be great full to you if you can help me out in retrieving recieved date of a mail. Regards sanjay    More>>

I am developing a application in which one of the feature is Mail Box .I am invoking getReceivedDate() method
on Message object by doing
Date d = message.getReceivedDate();

i am getting the value of d as null

always.I would like to know how to
retrieve the received date of a mail.

I am successfully retrieving sent date

by invoking getSentDate() on
the same Message object.

I would be great full to you if you
can help me out in retrieving
recieved date of a mail.

Regards

sanjay

   <<Less

!_NEWLINE_!Note that RFC 822 <font color=red>does not define a field for the received date</font>

Posted By:   James_Kelley  
Posted On:   Wednesday, December 5, 2001 06:54 PM


Note that RFC 822 does not define a field for the received date and getReceivedDate method is based on this.




You may want to try the below getHeader and then parse out the received Date from the data that looks like



Date Mesg Received : (from root@localhost)
by host.super-nova.net (8.10.2/8.10.2) id fB4BQb029024
for sysadmin@alabanza.com; Tue, 4 Dec 2001 06:26:37 -0500





// System.out.println("Date Mesg Received : "+message.getReceivedDate().toString()+"
");
String[] receivedData = message.getHeader("Received");
for(int k = 0; k < receivedData.length; k++)
{
System.out.println("Date Mesg Received : "+receivedData[k]+"
");
}
About | Sitemap | Contact