View Full Version : Attach a newly created file with CDONTS

01-03-2005, 10:32 PM
I'm still a bit new to asp, so if this is a simple question, forgive me.

I have a form that a user fills in. When the user clicks the submit button, it sends the data via an email to me using CDONTS, while also creating a word document version of the data. The idea is that I get notification that a work request was submitted, and the user gets a nice copy of the request for them to cherish.

However I was thinking, it might be nice to attach the newly created word file to the email that gets sent to me. Unfortunately, I don't know how to determine where this new word file gets saved to. It seems like it is being stored in the users cache, but how do I determine the path each time?

Any help is appreciated.

01-04-2005, 04:02 AM
How are you creating the Word document?

01-04-2005, 02:48 PM
I have one page, web_request_form.asp, that submits the data to another page, web_request.asp. web_request.asp uses the simple-

Response.ContentType = "application/msword"
Response.AddHeader "Content-Disposition", "attachment;filename=web_request.doc"

-to get the data into the word document. On that page I have some HTML formatted with a stylesheet to make the word document 'pretty'.

I can get the word document created, and I can get the email sent, but I can't get the two of them to play nicely together.

01-05-2005, 06:33 AM
In order for the Word doc to be attached to the email, it has to be created and saved first in the server.

Try reading this article about programmatically creating Word documents.