Spire.Email for .NET is a professional .NET Email library specially designed for developers to create, read and manipulate emails from any .NET (C#, VB.NET, ASP.NET) platform with fast and high quality performance.

Tue Mar 15, 2022 7:40 am

hi
each message has a entryid but it isn't available in message properties. how can get it?

icv64621
 
Posts: 3
Joined: Tue Feb 01, 2022 7:13 am

Tue Mar 15, 2022 10:34 am

Hello,

Thanks for your inquiry!
You can download our latest Spire.Email Pack(hot fix) Version:5.2.0 and refer to the below code to get the EntryID.
Code: Select all
OutlookFile olf = new OutlookFile(@"input.pst");
OutlookFolderCollection outlookFolderCollection = olf.RootOutlookFolder.GetSubFolders();
byte[] entryIds = null;
foreach (OutlookFolder folder in outlookFolderCollection)
{
    entryIds = folder.EntryId;
}
for(int i = 0; i<entryIds.Length; i++)
{
    Console.WriteLine(entryIds[i]);
}
Console.ReadLine();

If there is any other questions, please feel free to write back.

Sincerely,
William
E-iceblue support team
User avatar

William.Zhang
 
Posts: 200
Joined: Mon Dec 27, 2021 2:23 am

Tue Mar 15, 2022 3:32 pm

hello William.
thank you for response. i was searching for messages entryId. is there any way for that?

icv64621
 
Posts: 3
Joined: Tue Feb 01, 2022 7:13 am

Wed Mar 16, 2022 10:17 am

Hello,

Thanks for your reply!
At present our Spire.Email doesn't support directly get the messages entryId. Sorry we don't know much about the property of messages entryId. could you please provide us with more details? Such as the sample entryId value you want to get, some screenshots, or any help tutorials? And then we will consider adding a new feature to achieve it.

Sincerely,
William
E-iceblue support team
User avatar

William.Zhang
 
Posts: 200
Joined: Mon Dec 27, 2021 2:23 am

Wed Mar 16, 2022 2:37 pm

hello dear william. entry ID is a property which is fastest way to load a previously targeted outlook item from disk (i think this is because of file structure). the other ways are much much slower (ways like writing query using internetID, subject and etc).
each folder has a method called EnumerateMessagesEntryId() which doesn't work well and ignores some items.
in case of existence if entry id, the item could be loaded directly from OutlookFile.GetMessage( string messageID)

icv64621
 
Posts: 3
Joined: Tue Feb 01, 2022 7:13 am

Thu Mar 17, 2022 10:03 am

Hello,

Thanks for your reply and more information!
We have added it as a new feature into our upgrade list. Our Dev team is working on it now. And we will inform you as soon as it is achieved.

Sincerely,
William
E-iceblue support team
User avatar

William.Zhang
 
Posts: 200
Joined: Mon Dec 27, 2021 2:23 am

Tue Dec 13, 2022 5:37 pm

Hello. Has this been implemented? I see OutlookFolder objects have a RemoveItem method that takes a byte[] entry id as an argument, but I don't know how to get that for the message in question. The only ID I see in properties for OutlookItem is an internet message ID string, and while I haven't tried it I assume that would not work even if I convert to byte array.

Sylvaran
 
Posts: 7
Joined: Fri Sep 23, 2022 7:29 pm

Wed Dec 14, 2022 3:11 am

Sylvaran wrote:Hello. Has this been implemented? I see OutlookFolder objects have a RemoveItem method that takes a byte[] entry id as an argument, but I don't know how to get that for the message in question. The only ID I see in properties for OutlookItem is an internet message ID string, and while I haven't tried it I assume that would not work even if I convert to byte array.


Hello,

Thanks for your inquiry.
Sorry that the new feature with the number SPIREEMAIL-31 of getting email entry id is not solved currently. Once it is achieved, I’ll inform you in time.

Sincerely
Abel
E-iceblue support team
User avatar

Abel.He
 
Posts: 860
Joined: Tue Mar 08, 2022 2:02 am

Wed Dec 14, 2022 2:23 pm

Ah well. Just out of curiosity then, is there any way to use the RemoveItem method then? Maybe some other method I am not aware of?

Sylvaran
 
Posts: 7
Joined: Fri Sep 23, 2022 7:29 pm

Thu Dec 15, 2022 1:38 pm

Sylvaran wrote:Ah well. Just out of curiosity then, is there any way to use the RemoveItem method then? Maybe some other method I am not aware of?


Hello,

Thanks for your feedback.
Sorry that cannot directly call RemoveItem to delete the email currently. Howeve, you can add the undeleted outlookitem to new folder, then deleteing the older folder to achieve your requirement. I put the relevant code below for your reference.


Code: Select all
  string pstfile = @"../../data/from_Amy.pst";   
            OutlookFile outlookFile = new OutlookFile(pstfile);   
            OutlookFolderCollection ofc = outlookFile.RootOutlookFolder.GetSubFolders();     
            OutlookFolder folder = ofc[1].GetSubFolder("From_Amy");           
            IEnumerable<OutlookItem> items = folder.EnumerateOutlookItem();

            OutlookFolder NewFolder = outlookFile.RootOutlookFolder.AddFolder("NewFolder");
            foreach (var item in items)
            {
                //Add the undeleted OutlookItem that  to new folder
                NewFolder.AddItem(item);
            }

            //Romve the old OutlookFolder
            ofc.Remove(folder);


Sincerely
Abel
E-iceblue support team
User avatar

Abel.He
 
Posts: 860
Joined: Tue Mar 08, 2022 2:02 am

Thu Dec 15, 2022 4:34 pm

Thanks. I tried that, but it is not removing the original folder. From what you sent, it looks like it would just be removing the folder from the OutlookFolderCollection object that was created, but not actually making a change to the PST itself. Do I have to write it back somehow for it to take effect permanently?

Sylvaran
 
Posts: 7
Joined: Fri Sep 23, 2022 7:29 pm

Fri Dec 16, 2022 9:57 am

Hello,

Thanks for your feedback.
After further investigation, I did the issue you mentioned, accroding to the feedback from our development team, Spire.Emial don’t support folder currently. And I have logged it as a new function into our product updating system with the ticket number SPIREEMAIL-71. Our development team will achieve it. Once it is achieved, I will inform you in time. Sorry for the inconvenience caused.


Sincerely
Abel
E-iceblue support team
User avatar

Abel.He
 
Posts: 860
Joined: Tue Mar 08, 2022 2:02 am

Fri Dec 16, 2022 8:15 pm

No worries, I appreciate the responsive support :)

Sylvaran
 
Posts: 7
Joined: Fri Sep 23, 2022 7:29 pm

Wed Jun 14, 2023 4:41 am

Abel.He wrote:Hello,

Thanks for your feedback.
After further investigation, I did the issue you mentioned, accroding to the feedback from our development team, Spire.Emial don’t support folder currently. And I have logged it as a new function into our product updating system with the ticket number SPIREEMAIL-71. Our development team will achieve it. Once it is achieved, I will inform you in time. Sorry for the inconvenience caused.


Sincerely
Abel
E-iceblue support team

Hi. I just wanted to check in, as it's been about half a year. Any movement on this issue? Thanks!

Sylvaran
 
Posts: 7
Joined: Fri Sep 23, 2022 7:29 pm

Wed Jun 14, 2023 6:40 am

Hello,

Thanks for your inquiry.
Due to the complexity of the issue with the number SPIREEMAIL-71, sorry for our Dev doesn’t solve it currently. However, I have urged our Dev to speed up fixing your issue. Once there are any updates, I’ll inform you in time.

Sincerely
Abel
E-iceblue support team
User avatar

Abel.He
 
Posts: 860
Joined: Tue Mar 08, 2022 2:02 am

Return to Spire.Email