How can I have my page email a csv file created from an online form?

L

Les

I've just started working with ASP 5 days ago, so go easy on me.
My company needs an online form that user's can enter information into
and once submitted, will dump the user-supplied info into a csv file
and email it to the person who heads up the project. Initially, I
thought they wanted the form to save the data to a database, and after
playing all weekend, I was able to do that. Today I learned that they
prefer the emailing a csv file method instead.
Any links to tutorials on this subject or sample code with explanation
would be greatly appreciated! Again, I'm new at this and baby steps
are best :)

Thanks in advance,

Les
 
L

Les

Thank you for your quick response and the link.
<http://www.aspfaq.com/show.asp?id=2119> but I should have been more
explicit in my post.

As I've never done this before, I'm assuming that I can figure out how
to:

1. Write the data submitted in the form to a csv file
2. Save that to the server and then
3. Have the csv attached to an email and sent to the project manager.

My question is: can the csv file be created "on the fly" (not saved to
the server) and attached to the email which would be created from my
ASP page? I read through the aspfaq site, but was unable to find if
this were possible.

Once again thanks so much,

Les
 
C

Chris Hohmann

Les said:
Thank you for your quick response and the link.
<http://www.aspfaq.com/show.asp?id=2119> but I should have been more
explicit in my post.

As I've never done this before, I'm assuming that I can figure out how
to:

1. Write the data submitted in the form to a csv file
2. Save that to the server and then
3. Have the csv attached to an email and sent to the project manager.

My question is: can the csv file be created "on the fly" (not saved to
the server) and attached to the email which would be created from my
ASP page? I read through the aspfaq site, but was unable to find if
this were possible.

Once again thanks so much,

Les

Check out the GetDecodedContentStream Method of the BodyPart(attachment)
object
http://msdn.microsoft.com/library/en-us/cdosys/html/_cdosys_ibodypart_getdecodedcontentstream.asp

The basic premise is that all simple (versus multipart) bodyparts have
an associated stream interface. You can load content into the
bodypart(i.e. attachment) via the stream interface by using the
Write/WriteText methods. You indicated that you already know how to
retrieve the submitted file content from the Request object, but just in
case, here's an article that describes a component-less method for doing
so:

http://msdn.microsoft.com/library/en-us/dnasdj01/html/asp0900.asp

HTH
-Chris
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,266
Messages
2,571,082
Members
48,773
Latest member
Kaybee

Latest Threads

Top