Anyone know if there is a way to add a mail attachment file using just string instead of a physical file?
What I am looking to do is send a string of generated html as an attachment. I want to give it a file name without actually having to write it to disk. (I cannot just add it to the message because not all client e-mail systems support html)
In my ideal scenario, it would work like this:
(I have made up some property names, Content & PlugFileName, to show what I am looking to achieve.)
lsHtml = "<HTML> ……..</HTML>" ;
MailAttachment oAttachment = new MailAttachment();
oAttachment.Content = lsHtml ;
oAttachment.PlugFileName = "Report.htm" ;
MailMessage.Attachment.Add(oAttachment);
Thanks in advance,
Bridgett
Chris