Change name of emailed document to Email title
-
29-09-2020 - |
Question
I email a spreadsheet to SharePoint and I want to save the document not with its original name but with a name built from the title of the email - any ideas please?
For example: doc name is fhdhfjd1234.xls and email title "Cost Centre Report - TYEF". The name I want to see in SharePoint is "Cost Centre Report - TYEF.xls".
I also want to be able to populate the file metadeta using the email content too.
Solution
Sheena,
You can use SPEmailEventReceiver for your requirement..
And the following should help you
How to enable an Event Handler to intercept upload from email in document library
There is a possibility that when you write SPEmailEventReceiver the attachment doesn't upload directly, in that case you need to programmatically add an item (attachment) to document library and set metadata..