I’m trying to write a Gmail autoresponder using Java using IMAP to read the email and SMTP to respond to them. I read the emails with imap and when replying to the person who sent the email I use SMTP. I want the email I send to have the reply format, the same format you get when you click reply in gmail which includes the date and the message the sender initially sent. Is there a method in Javamail which will do this? If not what is the best way to do this?
Regards!
No. The JavaMail reply method will create a new Message with the appropriate headers for the reply, but it’s up to you to construct the body of the message, which is “just” a string manipulation problem.