I faced with same issue, when tried to send email with file attachment via EWS using SOAP webservices. Finally solution was found.
1)Create message and get ID of it.
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
<soap:Body>
<CreateItem MessageDisposition="SaveOnly"
xmlns="http://schemas.microsoft.com/exchange/services/2006/messages">
<SavedItemFolderId>
<t:DistinguishedFolderId Id="drafts" />
</SavedItemFolderId>
<Items>
<t:Message>
<t:ItemClass>IPM.Note</t:ItemClass>
<t:Subject>test 2</t:Subject>
<t:Body BodyType="HTML">this is
<b>bold</b></t:Body>
<t:ToRecipients>
<t:Mailbox>
<t:EmailAddress>[email protected]</t:EmailAddress>
</t:Mailbox>
</t:ToRecipients>
<t:IsRead>false</t:IsRead>
</t:Message>
</Items>
</CreateItem>
</soap:Body>
</soap:Envelope>
Get Response:
<?xml version="1.0" encoding="utf-8"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Header>
<h:ServerVersionInfo MajorVersion="15" MinorVersion="0" MajorBuildNumber="1497" MinorBuildNumber="46" xmlns:h="http://schemas.microsoft.com/exchange/services/2006/types" xmlns="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
</s:Header>
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<m:CreateItemResponse xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
<m:ResponseMessages>
<m:CreateItemResponseMessage ResponseClass="Success">
<m:ResponseCode>NoError</m:ResponseCode>
<m:Items>
<t:Message>
<t:ItemId Id="AAAYAE5pa29sYXkuR3VyeWFub3ZAYXphbC5hegBGAAAAAAAM4X07f1m5TruMA1KYuHzKBwCYiVmSeaoqQ5DPKXS6XYPUAAAAv1MsAACiYL/sCHf3TKGIeSfzqioDAAbhmG/mAAA=" ChangeKey="CQAAABYAAACiYL/sCHf3TKGIeSfzqioDAAbiJMe3"/>
</t:Message>
</m:Items>
</m:CreateItemResponseMessage>
</m:ResponseMessages>
</m:CreateItemResponse>
</s:Body>
</s:Envelope>
2)Create file attachment. Before do that turn your file into binary code and encrypt it with Base64 method. Then put hash of file to the tag "Content" like in below example:
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
<soap:Body>
<CreateAttachment xmlns="http://schemas.microsoft.com/exchange/services/2006/messages"
xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
<ParentItemId Id="AAAYAE5pa29sYXkuR3VyeWFub3ZAYXphbC5hegBGAAAAAAAM4X07f1m5TruMA1KYuHzKBwCYiVmSeaoqQ5DPKXS6XYPUAAAAv1MsAACiYL/sCHf3TKGIeSfzqioDAAbhmG/mAAA=" />
<Attachments>
<t:FileAttachment>
<t:Name>kassa.ini</t:Name>
<t:Content>
W0dlbmVyYWxdDQpzaG9wbm89OTkNCg0KDQpkYXRhc2hvcD1jOlxkcmVhbVxkYXRhc2hvcCAyLjAuYWNjZGINCmRhdGFISz1jOlxkcmVhbVxkYXRhSEsubWRiDQoNCnJlbSB2b29ycmFhZCB3YWFyc2NodXdpbmcNCnZvb3JyYWFkd2FhcnNjaHV3aW5nPS0xDQoNCnJlbSBwaW5uZW4NCkhlZWZ0UE9JUD0wDQpYVElMTkVYVD0tMQ0KDQpyZW0gbW9uc3RlciBrYXNzYQ0KSXNtb25zdGVyPTANCg0KcmVtIGF1dG9pbnZvZXIga25vcA0KYXV0b2ludm9lcj0tMQ0KDQpyZW0gdG91Y2hzY3JlZW4NCnRvdWNoc2NyZWVuPTANCg0KDQpbcGluXQ0KZGVmYXVsdHBpbj0wNQ0KcGluMDU9UkVOVDAxDQpwaW4wMz1HU00wMQ0KDQpbZXJyb3JdDQo=</t:Content>
</t:FileAttachment>
</Attachments>
</CreateAttachment>
</soap:Body>
</soap:Envelope>
Get the response:
<?xml version="1.0" encoding="utf-8"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Header>
<h:ServerVersionInfo MajorVersion="15" MinorVersion="0" MajorBuildNumber="1497" MinorBuildNumber="46" xmlns:h="http://schemas.microsoft.com/exchange/services/2006/types" xmlns="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
</s:Header>
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<m:CreateAttachmentResponse xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
<m:ResponseMessages>
<m:CreateAttachmentResponseMessage ResponseClass="Success">
<m:ResponseCode>NoError</m:ResponseCode>
<m:Attachments>
<t:FileAttachment>
<t:AttachmentId Id="AAAYAE5pa29sYXkuR3VyeWFub3ZAYXphbC5hegBGAAAAAAAM4X07f1m5TruMA1KYuHzKBwCYiVmSeaoqQ5DPKXS6XYPUAAAAv1MsAACiYL/sCHf3TKGIeSfzqioDAAbhmG/mAAABEgAQAPuV+vqkAj1FltQh+hc7myw=" RootItemId="AAAYAE5pa29sYXkuR3VyeWFub3ZAYXphbC5hegBGAAAAAAAM4X07f1m5TruMA1KYuHzKBwCYiVmSeaoqQ5DPKXS6XYPUAAAAv1MsAACiYL/sCHf3TKGIeSfzqioDAAbhmG/mAAA=" RootItemChangeKey="CQAAABYAAACiYL/sCHf3TKGIeSfzqioDAAbiJMe5"/>
</t:FileAttachment>
</m:Attachments>
</m:CreateAttachmentResponseMessage>
</m:ResponseMessages>
</m:CreateAttachmentResponse>
</s:Body>
</s:Envelope>
3)Now you can send email using the below request. Make sure you put correct ID and "Change key" value to the request. These values you get when receive response from above request.
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
<soap:Body>
<SendItem xmlns="http://schemas.microsoft.com/exchange/services/2006/messages"
SaveItemToFolder="true">
<ItemIds>
<t:ItemId Id="AAAYAE5pa29sYXkuR3VyeWFub3ZAYXphbC5hegBGAAAAAAAM4X07f1m5TruMA1KYuHzKBwCYiVmSeaoqQ5DPKXS6XYPUAAAAv1MsAACiYL/sCHf3TKGIeSfzqioDAAbhmG/mAAA="
ChangeKey="CQAAABYAAACiYL/sCHf3TKGIeSfzqioDAAbiJMe5" />
</ItemIds>
</SendItem>
</soap:Body>
</soap:Envelope>
response:
<?xml version="1.0" encoding="utf-8"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Header>
<h:ServerVersionInfo MajorVersion="15" MinorVersion="0" MajorBuildNumber="1497" MinorBuildNumber="46" xmlns:h="http://schemas.microsoft.com/exchange/services/2006/types" xmlns="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
</s:Header>
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<m:SendItemResponse xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
<m:ResponseMessages>
<m:SendItemResponseMessage ResponseClass="Success">
<m:ResponseCode>NoError</m:ResponseCode>
</m:SendItemResponseMessage>
</m:ResponseMessages>
</m:SendItemResponse>
</s:Body>
</s:Envelope>
Now all done. Email with file attachment sent successfully.