SOAP XML Request for EWS Managed API to send a attachment along with email message. RRS feed

  • Question

  • Hi,

    I could send an email and save its copy in sent items folder using  XML  Soap for SendAndSaveCopy.  Its XML Soap degails are given under " Creating and sending email messages by using the EWS Managed API"  subject. 

    But I need to send an text file available on my desktop (c:\desktop\SampleFile.txt) along with the email .   I couldn't find its XML Soap  request. 

    I tried with the following XML given below ( sample xml is available at topic "CreateAttachment Operation").   I am deleting the URL part, because I couldn't submit this request with URLs

    <?xml version="1.0" encoding="utf-8"?>
    <soap:Envelope xmlns:xsi=""
      <CreateAttachment xmlns=""
        <ParentItemId Id="AAAfAENhYWdJb" ChangeKey="CQAAABYA"/>

    It is attaching a junk file to the existing email  which is available in my inbox (existing email Item id = AAAfAENhYWdJb = ParentItemId in xml input ) .   It is not taking file from my desktop and attaching to the email. 

    Can anyone help me with that to check with SOAP UI.

    Thank you.

    • Edited by KSVK Thursday, January 30, 2014 7:44 PM
    Thursday, January 30, 2014 6:50 PM

All replies

  • There is a XML sample for using CreateAttachment .



    Wont read the Attachment from the FileSystem you need to do this youself (eg read the file into a Byte Array) and you then need to Base64 encode the Bytes and put that in the Content. All you should put the name element is the filename (which will be the attachment name on the message). eg


    You might want to look at the EWSEditor which you can use to perform EWS operations and look at the SOAP used.


    Friday, January 31, 2014 8:09 AM
  • Thank you.

    I am ble to attach a file now.



    Friday, January 31, 2014 2:15 PM
  • Posting this question separately

    • Edited by KSVK Friday, March 28, 2014 6:39 PM Posting as a question
    Friday, March 28, 2014 6:35 PM