Hi @skojer ,
Welcome to the Microsoft Q&A platform!
Based on your description, the "Set operation is not valid for the property" error you are encountering seems to be due to the way the attachment is handled in the request. This problem usually occurs when the attachment content is not encoded correctly or the attachment format is not correct.
You can try the following methods to solve this problem:
- The attachment content should be Base64 encoded. You can use a Base64 encoding tool to convert the file content to Base64.
- Make sure the attachment structure is correct. Here is what it should look like:
<t:Attachments>
<t:FileAttachment>
<t:Name>FileAttachment.txt</t:Name>
<t:Content>BASE64_ENCODED_CONTENT</t:Content>
</t:FileAttachment>
</t:Attachments>
- Another method is to save the message without sending it, then add the attachment, and finally send the message. This method works in some cases.
- Make sure your Exchange server version supports the operation you are trying to perform. Some older versions may not support certain features.
Please feel free to contact me for any updates. And if this helps, don't forget to mark it as an answer.
Best,
Jake Zhang