Hi,
I am using Aspose.Email 24.0 and Microsoft.Identity.Web 3.7.0 version. I am using Graph libraries to authenticate and restoring the functionality.
In IGraphClient interface, i find only create method, but not Append method. When i use create method the email is creating in mailbox folder but it is showing it as Draft which is wrong.
I want to know how can add the email by reading it from local PST file and add it to mailbox without loosing the origional email integrity like send time and received time etc…
I want to do only 1 email and not entire PST.
We are evaluating the library to use it our product and request for earliest response to make the decision.
Can you please provide more details about the method you are using to read the email from the PST file and how you are attempting to add it to the mailbox?
Sharing the relvant code that i wrote… Here pstObj is of class “Aspose.Email.Storage.Pst.PersonalStorage”
public List<Aspose.Email.MailMessage> ReadMessages(string folderName)
{
List<Aspose.Email.MailMessage> lstMsg = new List<Aspose.Email.MailMessage>();
Aspose.Email.Storage.Pst.FolderInfo folderObj = GetFolder(folderName, pstObj.RootFolder);
foreach (Aspose.Email.Storage.Pst.MessageInfo messageInfo in folderObj.GetContents())
{
lstMsg.Add(pstObj.ExtractMessage(messageInfo).ToMailMessage(new Aspose.Email.Mapi.MailConversionOptions()));
}
return lstMsg;
}
For adding into mailbox here is the relevant code to understand… Here client is an instance of the interface IGraphClient.
Hello @satyahc,
Welcome to our support forum!
Thanks for reaching out with your question.
This issue is not related to Aspose.Email. Unfortunately, the Graph API does not provide a direct Append method. The Create method is intended for creating a new email, which by default is saved as a draft.
Please consider using the Exchange Web Services (EWS) client or IMAP, which support the AppendMessage for adding emails while preserving all metadata.
Can I use EWS to develop a POC in interacting with office 365 mailbox and back up all contents like emails, calenders, tasks & contacts into PST file and then save it in my local hard disk?
Also I want to run my POC application in linux machine as console application.
Can you confirm me if it is capable to do?
Yes, you can retrieve mailbox content using EWS and export it to a PST file on Linux using Aspose.Email for .NET in a .NET Core Console App. As requested in another post, we will prepare a sample for a POC using EWS for you.