Free Support Forum - aspose.com

Aspose.Email for .NET for SharePoint 2013

We are using Aspose.Email for .NET (Version: 2.8.0) to extract metadata of emails in SharePoint 2010. I would like to know whether <span style=“font-size:10.0pt;font-family:“Tahoma”,“sans-serif”;
mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-ansi-language:
EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA”>Aspose.Email will support the same functionality in SharePoint 2013 or not.

<span style=“font-size:10.0pt;font-family:“Tahoma”,“sans-serif”;
mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-ansi-language:
EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA”>If yes, then do we have to use any other release or Aspose.email or no change required

Hi Gagan,


Thank you for writing to us.

Referring to the code sample below for Reading Emails from SharePoint server, you can see that Aspose.Email is only used to load the message from the Memory stream that contains the MSG data. Thus, Aspose.Email for .NET in this case should not be dependent on the SharePoint server version as the access to the file is managed by the SharePoint SDK. Please let us know if you have further query/inquiry in this regard. We’ll be glad to assist you further.

PS: I would recommend you to please use the latest version of Aspose.Email for .NET 2.9.0 in your applications to avoid any bugs that were found in previous versions.

Sample Code:

SPSecurity.CodeToRunElevated elevatedGetSite = new
SPSecurity.CodeToRunElevated(EstablishSharepoint);<o:p></o:p>

SPSecurity.RunWithElevatedPrivileges(elevatedGetSite);

// Path to the MSG file stored in Shared Documents folder

SPFile msgFile = web.GetFile("Shared Documents/Test.msg");

// Read the file into a memory stream.

MemoryStream fileStream = new MemoryStream();

byte[] currentFileContent = msgFile.OpenBinary();

fileStream.Write(currentFileContent, 0, currentFileContent.Length);

fileStream.Position = 0;

// Create an instance of the MailMessage class

// and pass the memory stream of the MSG file to it

MailMessage msg = MailMessage.Load(fileStream, MessageFormat.Msg);

fileStream.Close();

fileStream.Dispose();

Thanks for the response. Currently we are using .NET framework 3.5 and build this functionality using Aspose.Email for .NET (Version: 2.8.0).

If we decide to go with .NET Framework 4.0 as SharePoint 2013 support 4.0 framework so, in that case

1) Is there any code change required ?

2) Can we use the same Aspose.Email for .NET (Version: 2.8.0) with framework 4.0?

Thanks,

Gagan

Hi Gagan,


1) Changing to .NET Framework 4.0 won’t require any change other than referencing to the proper DLL version from the Bin folder of your PC

2) If you look at the Bin folder (in installation directory of Aspose.Email), you will find further sub folders in this folder for each specific target framework. Every new version of Aspose.Email has these versions and you can select any of these according to your requirements. You can continue using Aspose.Email for .NET 2.8.0, however, as 2.9.0 is the latest version with improved performance (as bugs reported in v 2.8.0 were fixed in this latest version), therefore, I recommend you to use this latest version in your applications.

Please feel free to write to us if you need further assistance in this regard.