MSG to EML but the Header (From-To-...) is missing on Internet Explorer

Hi,

with this code, I load a MSG File, remove all Attachments and save the mail as EML

MailMessage email_ohne_attach = MailMessage.Load(licurrent.File.OpenBinaryStream(),MessageFormat.Msg);

for (int i = 0; i <= email_ohne_attach.Attachments.Count; i++)

{

i = 0;

email_ohne_attach.Attachments.RemoveAt(i);

}

Stream FileStream = new MemoryStream();

email_ohne_attach.Save(FileStream,MessageFormat.Eml);

If I open this EML File with Internet Explorer, only the body will shown, the header with from,to,subject and so on is missing.

Any idea how to solve this problem?

By the way: in the internet I found something about aspose.network.mime.mimemessage, but in my aspose.network.dll I can't find this class :(

Thanks a lot

Hi,

Thanks for considering Aspose.

I tested exactly the same code as yours with an msg file (with 4 attachments). After saving file as eml, when I opened in Outlook Express (shipped with Windows XP), it contained From, To and Subject.

Could you please tell some more details, how did you open an eml file with Internet Explorer? A screenshot would be helpful. When I try to open an eml file with IE8, it shows "Address not valid error message"

Hey,

thanks for your answer. Yes you are right. If I open the mail with outlook express, from, to and so on will shown correctly.

But If I open this mail with the internet explorer, I only see the Body of the mail (as you can see in the attached screenshot).

Regards

Hi gradma,

Please use the attached dll and sample code:

MailMessage lmsg = MailMessage.Load(file);
lmsg.Save(file + "out.mht", MessageFormat.Mht);

Hi,

I used your dll and this was the result:

From:

Sent:

To:

Cc:

Subject: (Aspose.Network Evaluation)

Attachments: License.txt,

Nothing else will be shown, so the from column is empty and the body text is missing too.

Could you attched you eml file for our review?

Thanks

of course, here is the eml file which will be generated. if I open this email with sharepoint in internet explorer, only the bodytext will shown without from,to and so on

thanks for your help

Please check the attached hotfix.

I tested it with the attached solution but as MHT, the header column names will shown (from,to and so on) but the values are missing and the body text is missing to

As EML the page in IE is completely empty

Maybe you can give me your code(solution) if it runs correctly at your solution?

Hello,

Please check the zip and the *.mht output file.

with the attached eml file it works FINE, but if I try to convert from MSG to MHT, then there is a problem because you can see only a lot of numbers,characters and so on in the internet explorer (in this msg file there were attachments but this is required, but only for displaying)

Hello,

Could you please send me the msg file you used? So that we can debug into the problem.

Thanks,

on the attachment there is the MSG file, the generated EML file and the code how I generate the eml file

hope you find a solution