Subject property error when reading email using Aspose.Email

Hi, I’m using your API for Visual Studio (c# Language) and I have this problem: during reading, for a set of mails the “subject” property appears as “{number}”; for the other mails the subject is ok… how can I solve?
Thanks!

@mmaglio,

I have observed your comments and have not been able to completely understand your requirements. Can you please share a working sample project along with source files and what information you want to extract using Aspose.Email for .NET API. I also suggest you to please first try using Aspose.Email for .NET 19.9.

I’m using Aspose.Email in the versione 19.9! Downloaded by Nuget… I need to read the subject of the messages of a PEC mailbox to check if these mails must be saved into a documental repository but, for a kind of these messages, the subject is incorrect. For example: if the subject is “ACCETTAZIONE: Pratica num 2019_2258_1_1_12539 - Sinistro ATM 2019-2258 mercoledì 9 ottobre 2019 - 12:05”, when I read the property by c# code the result is “{70}”. Here is my code:

using (Imap imap = new Imap())
{
imap.SSLConfiguration.EnabledSslProtocols = SslProtocols.Tls12;

            imap.Connect("imap.xxxx", 993, true);    // use ConnectSSL for SSL 
            imap.UseBestLogin("xxx@atmpec.it", "xxxx");
            imap.Select("xxxxx");
            List<long> uids = imap.Search(Flag.All);
            foreach (long uid in uids)
            {
                var eml = imap.GetMessageByUID(uid);

                IMail email = new MailBuilder()
                    .CreateFromEml(eml);
                email.Save(@"xxxxx" + uid + ".eml");
                Console.WriteLine(uid + " - " + email.Subject);
            }
            imap.Close();
        }

Thanks, have a nice day!

@mmaglio,

Can you please share source file so that we may further investigate to help you out.

Ok, in the attachment there is my VS solution… thank you so much!TestPEC - Copia.zip (5.7 MB)

@mmaglio,

I have worked with sample project shared by you. The project does not have any source eml file which is creating problem for you. Can you please share source eml file so that we may further investigate to help you out.

Here an eml into a zipped file which is creating problem (the value of “subject” property is “{70}”)message.zip (6.9 KB)

Thx!

@mmaglio,

I have worked with the sample file shared. An issue with ID EMAILNET-39609 has been created in our issue tracking system to further investigate and resolve the issue. This thread has been linked with the issue so that you may be notified once the issue will be fixed.

1 Like

@mmaglio,

We have investigated issue on our end. This is not a bug of Aspose.Email. In the solution shared you have used reference on Mail.dll. I suggest you to please contact respective support team for your kind reference in this regard.

Sorry, the solution was wrong, in the attach files you can find the correct solution. Thank’s!
TestPEC - Copia.zip (600.0 KB)

@mmaglio,

I have been able to observe the issue after initial investigation. I like to inform that we are working on it and will reopen this issue. I request for your patience.

Hi, have you news for me?

@mmaglio,

We have reopened the ticket based on information shared by you and request for your patience till the issue gets resolved. We will share the good news with you as soon as it will be fixed.

Excuse me, I need to have news about the problem’s solution because I have an application that doesn’t work correctly in a production environment. Can you help me? Otherwise I will search another DLL to get email’s informations… Thanks a lot!!

@mmaglio,

We are sorry for your inconvenience. We understand your concerns. We are verifying the issue in view of new information shared by you. We request for your patience and will share the good news with you as soon as issue will be addressed.

The issues you have found earlier (filed as EMAILNET-39609) have been fixed in this update.

Thank you! The subject’s problem has been solved but, with the new version of your API, I have now another error: when I download a mail into .eml file, some of these files has size of 0KB. Can you help me?
Thank you so much!

@mmaglio,

I have observed the new feedback shared by you and request you to please share the working sample code along with source and generated files for reproducing on our end.

In the solution added into the reply of 18th October you can find the line of code that downloads the mail into an .eml file by SaveTo method of your API.
Thanks!

@mmaglio,

I have tried using the sample project shared by you using Aspose.Email for .NET 19.11 on my end. However, I am getting StackOverflow exception on my end on using your sample project as it is pointing to list messages from a specific folder. Can you please ensure if the folder selected is right? Also, you have mentioned that some messages have 0 KB email file. My request to you would be to kindly share such source MSG and EML files that we may try to investigate further on our end.