none
Is Javascript API for Exchange? RRS feed

  • Question

  • Hi,

    Is there API for Exchange to use it in javascript?

    I create App for Office (type Mail) and I would like to get selected mail and send to my WCF Service as EML file.

    Thanks.

    Monday, March 17, 2014 11:05 AM

Answers

  • I don't know of any JavaScript client APIs for Exchange outside of what you can do with mail apps for Outlook. I'm fairly sure that you can request the MIME content of an email by using a mail app. The MIME stream can be written to a .eml file. Assuming this article:

    http://msdn.microsoft.com/en-us/library/office/jj190901(v=exchg.150).aspx

    Change step 3, <GetItem> element to:

     '    <GetItem xmlns="http://schemas.microsoft.com/exchange/services/2006/messages">' + '      <ItemShape>' + '        <t:BaseShape>IdOnly</t:BaseShape>' + '
     <t:IncludeMimeContent>true</t:IncludeMimeContent>' + '        <t:AdditionalProperties>' + '            <t:FieldURI FieldURI="item:Subject"/>' + '        </t:AdditionalProperties>' + '      </ItemShape>' + '      <ItemIds><t:ItemId Id="' + id + '"/></ItemIds>' + '    </GetItem>';
    Note that I added the <t:IncludeMimeContent>true</t:IncludeMimeContent> element.

    With regards,


    Michael | Microsoft Exchange Developer Content

    The Exchange Development Forum Guide has useful information for using the Exchange Development Forum.

    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

    • Marked as answer by Prog-NET Tuesday, March 18, 2014 1:08 PM
    Monday, March 17, 2014 4:27 PM
    Moderator

All replies

  • I don't know of any JavaScript client APIs for Exchange outside of what you can do with mail apps for Outlook. I'm fairly sure that you can request the MIME content of an email by using a mail app. The MIME stream can be written to a .eml file. Assuming this article:

    http://msdn.microsoft.com/en-us/library/office/jj190901(v=exchg.150).aspx

    Change step 3, <GetItem> element to:

     '    <GetItem xmlns="http://schemas.microsoft.com/exchange/services/2006/messages">' + '      <ItemShape>' + '        <t:BaseShape>IdOnly</t:BaseShape>' + '
     <t:IncludeMimeContent>true</t:IncludeMimeContent>' + '        <t:AdditionalProperties>' + '            <t:FieldURI FieldURI="item:Subject"/>' + '        </t:AdditionalProperties>' + '      </ItemShape>' + '      <ItemIds><t:ItemId Id="' + id + '"/></ItemIds>' + '    </GetItem>';
    Note that I added the <t:IncludeMimeContent>true</t:IncludeMimeContent> element.

    With regards,


    Michael | Microsoft Exchange Developer Content

    The Exchange Development Forum Guide has useful information for using the Exchange Development Forum.

    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

    • Marked as answer by Prog-NET Tuesday, March 18, 2014 1:08 PM
    Monday, March 17, 2014 4:27 PM
    Moderator
  • What a pity that there is not API for javascript:/.

    Thanks Michael for your answer.
    Your advice about how to get email as ELM work perfectly:).

    I only wonder that is possible to get this data as bate[] instead XML from Exchange?
    This will be reduced data transfer a lot.

    Tuesday, March 18, 2014 1:31 PM