Hi Alex,
Thank you for writing to Aspose support team.
I was able to observe the issue of 0 attachments and 0 recipients count for the embedded message and have logged it as NETWORKNET-34301 in our issue tracking system. Once the issue is fixed and there is some update available in this regard, we’ll write back here via this thread.
For investigating the other issue, could you
please share with us how you removed the email properties? We are further
investigating the issue and your feedback will help us in this regard.
Hi Kashif,
how you removed the email properties
Not sure that I understood your question correctly. Will try to answer:
· I wrote that I had removed headers from “MainMessage.eml”. I did it in text editor.
· I wrote that “EmbeddedMessageInTnefFormat” is embedded message extracted from TNEF. I did it by means of Microsoft.Exchange.Data.ContentTypes.Tnef.TnefReader from Microsoft.Exchange.Data.Common.dll library.
private static void SaveAttachFromTnef(string srcPath)
{
EmailMessage email;
using (var fs = File.OpenRead(srcPath))
email = EmailMessage.Create(fs);
MimePart tnefPart = email.TnefPart;
using (TnefReader reader = new TnefReader(tnefPart.GetContentReadStream()))
{
while (reader.ReadNextAttribute())
{
var sdg = reader.AttributeTag;
if (reader.AttributeTag == TnefAttributeTag.Attachment)
{
while (reader.PropertyReader.ReadNextProperty())
{
if (reader.PropertyReader.PropertyTag.Id == TnefPropertyId.AttachData)
{
//read data here
}
}
}
}
}
}
If I did not answer your question, please rephrase and let me know. Will do my best to provide you with additional information.
Thanks,
Alex Shloma
Hi Alex,
Hi Alex,
MailMessage mainMail = MailMessage.Load(fileName);
MapiMessage mapi = MapiMessage.FromMailMessage(mainMail);
MapiMessage embeddedFromProperties = MapiMessage.FromStream(new MemoryStream(mapi.Attachments[0].ObjectData.Data));
Console.WriteLine(embeddedFromProperties.Attachments.Count); //It should display 1
Console.WriteLine(embeddedFromProperties.Recipients.Count); //It should display 2
I tried new Aspose.Mail.dll and code snippet you provided. In debug I see correct number of recipients and attachments of embedded message.
var mainMail = MailMessage.Load(“MainMessage.eml”);
var mapiMain = MapiMessage.FromMailMessage(mainMail);
var embeddedMessageStream =
new MemoryStream(mapiMain.Attachments[0].ObjectData.Data);
var embedded = MapiMessage.FromStream(embeddedMessageStream);
embedded.Save(“Lost
recipient.msg”);
“Lost recipient.msg” will contain only one recipient if you open it in Outlook.
Hi Alex,
Hi Kashif Iqbal,
Can you please tell me is there abilityto see all issues (I mean registered and assigned to developer, like “NETWORKNET-34353”) connected with a certain thread.
I ask, because sometimes we report several issues within one thread, and I do not know which of them were investigated, discussed with developers…
Thank,
Alex Shloma
Hi Alex,
Could you please move this ticket to Priority Support forum?
Thanks in advance,
Hi Alex,
Hi Kashif,
Hi Alex,
You are welcome and please feel free to write to us in case you have any additional query/inquiry related to Aspose.Email.
Hi, Kashif Iqbal.
The issues you have found earlier (filed as NETWORKNET-34353) have been fixed in this update.
This message was posted using Notification2Forum from Downloads module by Aspose Notifier.