views:

338

answers:

3

I am familiar with sending email from Java programs. Is it possible to configure the email so that Outlook will recognize that it should expire at a certain time?

+3  A: 

Add an "Expiry-Date" Header (see RFC1327).

mdm
+4  A: 

I believe Outlook honors the, now deprecated, Expiry-Date header. You can add this to the MimeMessage headers. The format for the value is "EEE, d MMM yyyy hh:mm:ss Z"

Ryan Emerle
If it is deprecated what can you use now?
hhafez
"Expires" is the new one. Defined in RFC2156 and RFC4021. No idea if Outlook supports it.
derobert
A: 

Add a header to the MimeMessage called "Expiry-Date" using the (joda-time) format "EEE MMM d HH:mm:ss yyyy Z"

The other answers are good, but I used a slightly different format.

Craig P. Motlin