Saving .eml message to SharePoint from MailMessage
We currently have a SharePoint solution in place to send email via a SharePoint service.  SalesForce code calls a WCF service hosted in SharePoint.  The SharePoint code performs a lookup on a specific document library for a set of files.  The files are added as attachments and the email is sent out using the SMTP client.

The business has aksed if we can save the outgoing email (.eml) file directly into the SharePoint document library as a receipt.  Is there any way to so this at the time the email is sent?  I have not found a way to save the entire message as a byte stream to create a SPFile in the document library.

My alternative solution is to use an email enabled document library and BCC a copy of the email this library.  I could then use an email event receiver to push the receipt to the correct SharePoint location based on the file name. 

Any help would be much appreciated.
July 31st, 2015 12:04pm

Hi,

If the outgoing emails are stored in a directory on your any of the server , then my suggestion would be create the "Windows Service" to monitor the email files on the directory.

You can write the logic to save the as stream and then add to SharePoint library.

Have a look at this link , it could be useful and give some idea for this requirement.

Free Windows Admin Tool Kit Click here and download it now
July 31st, 2015 1:41pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics