4
일부 이메일에 자동으로 회신 할 수있는 소규모 클라이언트를 구축 중입니다. 이 답장에 맞춤 인터넷 헤더를 추가하고 싶습니다.EWS Managed API : 인터넷 헤더를 추가하는 동안 메시지에 회신하기
내가 시도한 것은 수신 한 전자 메일에 확장 속성을 설정하고 EmailMessage.Reply
메서드를 사용하는 것입니다.
하지만 작동하지 않습니다. 나는 또한 EmailMessage.CreateReply
을 사용하려고 시도했다. 그러나 SetExtendedProperty
메서드가없는 ResponseMessage
개체를 만듭니다.
이 코드의 관련 부분 :
private static readonly ExtendedPropertyDefinition _redFlag = new ExtendedPropertyDefinition(DefaultExtendedPropertySet.InternetHeaders, "X-RED", MapiPropertyType.String);
private static readonly PropertySet _customHeaders = new PropertySet(BasePropertySet.FirstClassProperties, _redFlag);
/* ... some code to connect to Exchange Service ... */
EmailMessage email = EmailMessage.Bind(_service, id, _customHeaders);
email.SetExtendedProperty(_redFlag, "test");
email.Reply(new MessageBody(answer), false);