Hello
I am trying to add the message as attachment to itself and save it as an .eml
I am loading it as an MapiMessage, then converting it to mailmessage
Here is the sample code that is not working.
var m = MapiMessage.Load(…);
var temp = m.Copy();
temp.Attachments.Add(m.Subject+ “.msg”, m);
var mail = temp.ToMailMessage(new MailConversionOptions())
mail.save(…, new EmlSaveOptions())
The above code is not working, however if we use the overloading of Attachments.Add() method it will work like this
(using MemoryStream stream = new MemoryStream()){
m.Save(stream, new MsgSaveOptions());
temp.attachments.Add(m.Subject+".msg",stream.toArray())
}
Is this bug, or the way it should work?
Below I will attach sample input message(.msg) and corrupted output(.emlDS_[Kotak] Economy The missing tax filers - Copy.zip (811.3 KB)
)