I've been searching for sample code for a while, but to no avail. Here's the scenario:
- users share images from mobile phones using e-mail sharing.
- on Exchange Server 2010 a mailbox is configured to receive these messages.
- we need a trigger on the Exchange Server that will fire on new mail arriving in said mailbox.
- a script should distinguish sender address, subject, and attachment.
- the script should convert these 3 elements to a multipart/form-data http POST request.
- the POST request should be submitted to a web-based handler, which will do the necessary to make sure the image is saved on a webserver and an accompanying record is created in a database. The handler exists and currently works from an HTML form.
What I can't find out: how to trigger the script to run on the Exchange server (through EWS that is, I can do it with SMTP hooks, but those were deprecated); how to convert the mail item fields to form data.
Any help greatly appreciated.