I'm sending an excel file as an attachment. the file is generated from an HTML table and when I open it, I receive a warning message stating: "the file format and extension don't match....."
here's my code:
string html = "<table><tr><td>Test</td></tr></table>";
System.Net.Mime.ContentType ct = new System.Net.Mime.ContentType("application/vnd.ms-excel");
Attachment a = Attachment.CreateAttachmentFromString(html.ToString(), ct);
a.ContentDisposition.FileName = "Test.xls";
Am I missing something in this snippet?
Thanks in advance for the help,
thanks inadvance for the help .