dcsimg

How can I set the Message-ID header for a message via JavaMail?

John Zukowski

You'll need to subclass MimeMessage and override the updateHeaders() method. In the subclass, call super.updateHeaders(), then set the Message-ID header for your custom header value.