MHTML attachment sent programmatically

L

Lilia Roum

Hello,
My problem is, and this problem occurs only in Office Outlook, in
Outlook express and in IE it is fine.
When I send MHTML file as an attachment from my application (I use
MailMessage and MailAttachment classes), if I open the message in
Office Outlook the attachment appears as "Unknown Attachment". If I
click on it Outlook opens a message window with attached MHTML file
embedded.
How can I overcome this issue and make Outlook to show the attachment
with it's actual name?
Thank you in advance.

My code is here.

MailMessage mail = new MailMessage();

mail.From = "...";
mail.To = "...";
mail.Subject = "...";

mail.BodyFormat = MailFormat.Html;

MailAttachment attachment = new MailAttachment( "C:\\TestReport.mht );
mail.Attachments.Add( attachment );

SmtpMail.SmtpServer = "localhost";
SmtpMail.Send(mail);
 
Top