By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,811 Members | 785 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,811 IT Pros & Developers. It's quick & easy.

Create a file in memory and than email

P: n/a
I am working on creating a web service that will create a signed xml file.
I would like to create this file in memory and than somehow email it to the
user that requested it to be generated. I would prefer a solution that does
not require the file to be first wrote to disk or requires the user to save
the file from the browser.

I know I can create a file using MemoryStream, but I not sure on how to
transform that MemroyStream into an actual file to attach to an email.

Thanks
Amy.
Nov 17 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
I did a simple SMTP client that can do that:

byte[] ba = Encoding.UTF8.GetBytes("This is the attachment.");
Smtp smtpClient = new Smtp("mail.myserver.com.", 25);
smtpClient.Send("us**@domain.com", "me@mydomain.com", "subject", "Here is
the file...", "attach.txt", ba);

http://spaces.msn.com/members/staceyw/Blog/cns!1pnsZpX0fPvDxLKC6rAAhLsQ!361.entry

--
William Stacey [MVP]

"Amy L." <am**@paxemail.com> wrote in message
news:%2******************@TK2MSFTNGP14.phx.gbl...
I am working on creating a web service that will create a signed xml file.
I would like to create this file in memory and than somehow email it to
the
user that requested it to be generated. I would prefer a solution that
does
not require the file to be first wrote to disk or requires the user to
save
the file from the browser.

I know I can create a file using MemoryStream, but I not sure on how to
transform that MemroyStream into an actual file to attach to an email.

Thanks
Amy.

Nov 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.