The Web.Mail namespace depends on the CDOSYS (Collaboration Data Objects for Windows 2000) component. I only see filenames supported for attachments. My guess is that you would need to write it to a temp file and clean up the temp file after you send.
>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