I am dynamically generating a number of different types of files based upon a GridView in ASP.NET - an Excel spreadsheet and a HTML file. I am doing so using this code (this is
You might be able to create System.Net.Mail.Attachment from string then send out the mail as normal.
var m = new System.Net.Mail.MailMessage(from, to, subject, body);
var a = System.Net.Mail.Attachment.CreateAttachmentFromString(stringWrite.ToString(), "application/vnd.xls");
m.Attachments.Add(a);