messageBuffer.append("Subject: " + subject + "\r\n");
messageBuffer.append("Content-Type: " + mailmessage.getContentType()+"\r\n");
SimpleDateFormat formatter = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss ");
StringBuffer date = new StringBuffer(formatter.format(mailmessage.getSentDate()));
// Add timezone offset
Calendar gmt = Calendar.getInstance(TimeZone.getTimeZone("GMT"));
Calendar local = Calendar.getInstance();
gmt.setTime(mailmessage.getSentDate());
local.setTime(mailmessage.getSentDate());