B
Bertus Dam
I'm trying to create an e-mail with a dynamic word attachment like this:
System.Web.Mail.MailAttachment cAtt = new
System.Web.Mail.MailAttachment("test.aspx");
test.aspx is a webform which does a:
Response.ContentType = "application/msword";
Response.AppendHeader("Content-disposition",
"attachment;filename=Word.doc");
and a couple of Response.Writes. That's my Word-document I want as the
e-mail attachment.
When I send the e-mail however, the file that gets attached is the test.aspx
file itself, instead of the "rendered" version. I know I can make a file on
the server with a streamwriter and attach that file, but that's not what I
want. I want the attachments to be dynamically generated. Does anyone know
how to do this?
Bertus
System.Web.Mail.MailAttachment cAtt = new
System.Web.Mail.MailAttachment("test.aspx");
test.aspx is a webform which does a:
Response.ContentType = "application/msword";
Response.AppendHeader("Content-disposition",
"attachment;filename=Word.doc");
and a couple of Response.Writes. That's my Word-document I want as the
e-mail attachment.
When I send the e-mail however, the file that gets attached is the test.aspx
file itself, instead of the "rendered" version. I know I can make a file on
the server with a streamwriter and attach that file, but that's not what I
want. I want the attachments to be dynamically generated. Does anyone know
how to do this?
Bertus