private static Date getSentDate ( MimeMessage msg , Date defaultVal ) { if ( msg == null ) { return defaultVal ; } try { Date sentDate = msg . getSentDate ( ) ; if ( sentDate == null ) { return defaultVal ; } else { return sentDate ; } } catch ( MessagingException me ) { return new Date ( ) ; } }
Compute sent date