This almost works for me but not quite.
I have a shared mailbox to which I received emails containing any manner of embedded or attached images/pdf etc.
I need the attachments and embedded images to be saved to a location on sharepoint.
I then need the email moving to another folder.
Finally I need an email sent to the original sender to confirm we received their attachments.
I have so far got this working perfectly using a different example to that above except it doesn’t save the embedded photos. I have tried to follow your method and whilst it does save all the images including attachments and embedded ones, I end up sometimes with multiple emails in the inbox which don’t get deleted, and multiple copies of the attachments and images saved in sharepoint.
There must be a way of getting this to work so it just saves the attachments once, and I don’t end up with multiple emails sat in the inbox.
Any help appreciated!