I am drafting email in custom folder.
EmailMessage msg= new EmailMessage(service);
msg.setSubject("Hello world!");
msg.setBody(MessageBody.getMessageBodyFromText("Draft email using the EWS Java API."));
msg.getToRecipients().add("[email protected]");
// Tried to set extended property but not worked
ExtendedPropertyDefinition headerProperty = new ExtendedPropertyDefinition(
DefaultExtendedPropertySet.InternetHeaders,
"X-Classification",
MapiPropertyType.String);
msg.setExtendedProperty(headerProperty,"Provision X-header Internet message header");
msg.save(CUSTOM_FOLDER_ID);
I came to know that extended property will be helpful for classification/permission header. Ref link - https://learn.microsoft.com/en-us/exchange/client-developer/exchange-web-services/how-to-provision-x-headers-by-using-ews-in-exchange But how to set classification/permission ? X-Classification-Restricted something like this or any other way ?
I dont want to use setImportance / setSensitivity methods.
Manually we are setting in following way
Expectation from ews api to set classification/permission from code
How to set permission/classification(public/Restricted/Internal) to EmailMessage using ews java api?
Code snippet of working example appreciated. Thanks in advance