I am using ews-java-api
I need to filter the emails using alias emails.
I mean, i have a mail account a@b.com and also a alias email b@b.com for this account.
Now user can send email to b@b.com and this emails comes to index of a@b.com, Now i need to filter those emails which comes to b@b.com address
I have tried below code but not helping which filed hold alias of b@b.com
FindItemsResults<Item> fiResults = exchangeService.findItems(WellKnownFolderName.Inbox, new ItemView(100));
PropertySet propertySet = new PropertySet(BasePropertySet.FirstClassProperties, ItemSchema.MimeContent);
exchangeService.loadPropertiesForItems(fiResults, propertySet);
for (Item item : fiResults) {
String messageContent = new String(((EmailMessage) item).getMimeContent().getContent());
System.out.println(messageContent);
}
output is some thing like this:
"null" -> "Received: from .namprd11.prod.outlook.com
by .namprd11.prod.outlook.com with HTTPS via
PROD.OUTLOOK.COM; Tue, 27 Mar 2018 07:21:50 +0000
Received: from namprd11.prod.outlook.com (10.175.62.11) by
namprd11.prod.outlook.com (10.172.70.13) with Microsoft SMTP
Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id
15.20.609.10; Tue, 27 Mar 2018 07:21:49 +0000
Received: from CY4PR11MB1941.namprd11.prod.outlook.com
([fe80::dcc2:abd8:21c8:9bba]) by .namprd11.prod.outlook.com
([fe80::dcc2:abd8:21c8:9bba%18]) with mapi id 15.20.0609.012; Tue, 27 Mar
2018 07:21:49 +0000
From: "user, pre" <a@b.com>
To: " pre" <a@b.com>
Subject: Testing Emails with One attachment
Thread-Topic: Testing Emails with One attachment
Thread-Index: AQHTxZxElAIQ6TfnUU+t50OSMcm/SQ==
Date: Tue, 27 Mar 2018 07:21:49 +0000
Me"
IN above output to and from showing a@b.com, but in actually i have send it from b@b.com and from was also b@b.com
Need help