Open l0ckm4 opened 5 years ago
Even I am struggling to find any documentation on this.
I know this is old, but I was able to successfully add a custom X-Header to my Message. And I was searching for a solution myself.
You must add a ExtendedPropertyType to the MessageType->ExtendedProperty[]
Example $Message = new MessageType(); / Add all Message Requirements /
//Add a Extended Property $EP = new ExtendedPropertyType(); $EP->ExtendedFieldURI = new PathToExtendedFieldType(); $EP->ExtendedFieldURI->DistinguishedPropertySetId = "InternetHeaders"; $EP->ExtendedFieldURI->PropertyName = "X-Dwc-Test"; //The custom X-Header $EP->ExtendedFieldURI->PropertyType = MapiPropertyTypeType::STRING; $EP->Value = 'String';
//Add the X-Header $Message->ExtendedProperty[] = $EP;
// Send the Message
I'm using it to know what department to send a list of emails to when/if the message bounces back from a un-monitored mailbox. I have to parse through the body of the Bounce message for it, but it is there.
I know this is old, but I was able to successfully add a custom X-Header to my Message. And I was searching for a solution myself.
You must add a ExtendedPropertyType to the MessageType->ExtendedProperty[]
Example $Message = new MessageType(); / Add all Message Requirements /
//Add a Extended Property $EP = new ExtendedPropertyType(); $EP->ExtendedFieldURI = new PathToExtendedFieldType(); $EP->ExtendedFieldURI->DistinguishedPropertySetId = "InternetHeaders"; $EP->ExtendedFieldURI->PropertyName = "X-Dwc-Test"; //The custom X-Header $EP->ExtendedFieldURI->PropertyType = MapiPropertyTypeType::STRING; $EP->Value = 'String';
//Add the X-Header $Message->ExtendedProperty[] = $EP;
// Send the Message
I'm using it to know what department to send a list of emails to when/if the message bounces back from a un-monitored mailbox. I have to parse through the body of the Bounce message for it, but it is there.
Stunning - thank you :-)
it didnt work for me. Did it work for anyone?
Version (e.g. 1.0, dev-master): 1.0 PHP version: 5.4 Microsoft Exchange version: Exchange 2010 Description of problem: Need to set custom X-Headers
Is there any way to set custom x-headers to emails created using the 1.0 library?