I'm trying to send an e-mail using Exchange Web Services that has an extra x-header set. I have a working sample that can send the e-mail, but I can't figure out how to add an x-header. How do I do this?
You need to add it as an extended property using the InternetHeaders Propset GUID so if you take the sample from the SDK http://msdn2.microsoft.com/en-us/library/bb408521.aspx all you need to add is PathToExtendedFieldType epExPath1 = new PathToExtendedFieldType(); epExPath1.DistinguishedPropertySetId = DistinguishedPropertySetType.InternetHeaders; epExPath1.DistinguishedPropertySetIdSpecified = true; epExPath1.PropertyName = "x-myheader"; epExPath1.PropertyType = MapiPropertyTypeType.String; ExtendedPropertyType exprop1 = new ExtendedPropertyType(); exprop1.ExtendedFieldURI = epExPath1; exprop1.Item = "blah"; message.ExtendedProperty = new ExtendedPropertyType[] { exprop1 }; Cheers Glen wrote in message news:186e7a7a-a5d4-4a5d-a52d-fb6b334735df@l6g2000prm.googlegroups.com... > I'm trying to send an e-mail using Exchange Web Services that has an > extra x-header set. I have a working sample that can send the e-mail, > but I can't figure out how to add an x-header. How do I do this?
Thanks, that works perfectly. On Jan 7, 8:51 pm, "Glen Scales [MVP]" wrote: > You need to add it as an extended property using the InternetHeaders Propset > GUID so if you take the sample from the SDKhttp://msdn2.microsoft.com/en-us/library/bb408521.aspxall you need to add > is > > PathToExtendedFieldType epExPath1 = new PathToExtendedFieldType(); > epExPath1.DistinguishedPropertySetId = > DistinguishedPropertySetType.InternetHeaders; > epExPath1.DistinguishedPropertySetIdSpecified = true; > epExPath1.PropertyName = "x-myheader"; > epExPath1.PropertyType = MapiPropertyTypeType.String; > > ExtendedPropertyType exprop1 = new ExtendedPropertyType(); > exprop1.ExtendedFieldURI = epExPath1; > exprop1.Item = "blah"; > message.ExtendedProperty = new ExtendedPropertyType[] { exprop1 }; > > Cheers > Glen > > wrote in message > > news:186e7a7a-a5d4-4a5d-a52d-fb6b334735df@l6g2000prm.googlegroups.com... > > > I'm trying to send an e-mail using Exchange Web Services that has an > > extra x-header set. I have a working sample that can send the e-mail, > > but I can't figure out how to add an x-header. How do I do this?