Search code examples
javajakarta-mail

Message Sent time incorrect using javax mail


greetings all i have a problem that when sending an email from the server to the client using javax mail and set the sentDate to

message.setSentDate(new Date());

the email is sent in the server time and the client receive the email immediately with time 5 hours ago ???? how to fix this to send and receive in correct timing ?


Solution

  • it was a server incorrect time problem i set the time and the timezone to GMT and it works fine now