Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Email header properties from Outlook Exchange

Santosh MishraMay 31 2017 — edited Jun 1 2017

Hi,

I am facing some problem in accessing email header in JAVA mail API.

I face this problem specially when mail is sent from Outlook Exchange.

Please check out the scenario...

I sent an email from Outlook exchange to a email client lets assume gmail or zoho mail.

Again i go to sent items and reply to the same email and in that case In-Reply-To and ReferencesHeader are null.

So i thread emails based on one of these to properties in my application.

Same scenario works well when i send email from any other email client except outlook exchange.

Please check code snippet to get In Reply To

          // InReplyTo

          String[] headerArray  = Message.getHeader("In-Reply-To");//No I18N

          if (headerArray != null && !headerArray[0].equals("")) {

                 inReplyTo =  headerArray[0];

          }

          // ReferenceHeader

          String[] headerArray  = Message.getHeader("References");//No I18N

          if (headerArray != null && !headerArray[0].equals("")) {

                 referencesHeader =  headerArray[0];

          }

Thanks N Regards

Santosh Mishra

This post has been answered by Bill Shannon-Oracle on May 31 2017
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 28 2017
Added on May 31 2017
3 comments
1,121 views