Form Results as Attach in email

  • Thread starter Thread starter TNT
  • Start date Start date
T

TNT

Is there any way to attach form results as an attachment
in an email once the submit is pressed? I've done
everything else, send as email, send as file to folder on
server, send to database, etc. With all this technology,
surely something so simple can be accomplished?

Thanks

TNT
 
It CAN be accomplished. However, you would have to either write your own
server-side form handler to do it, using ASP, CGI, or what-have-you,or find
a ready-made app that you can use in your web to do it. I haven't looked at
SEND-IT from Webs Unlimited lately. You might investigate that. Mike from
Webs Unlimited is a regular here. Maybe he will see this and respond.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
http://www.takempis.com
Big Things are made up of
Lots of Little Things.
 
<%
Set MailObject = Server.CreateObject("CDONTS.NewMail")
attFile = "c:\attachments\StandardPolicy.txt" 'Replace this path
with the path of you file.
attName = "Policy.txt"
MailObject.From = "(e-mail address removed)"
MailObject.To = "(e-mail address removed)"
MailObject.Subject = "Subject Text Here"
MailObject.Body = "Body Text Here"
MailObject.AttachFile attFile, attName
MailObject.Send
Set MailObject = Nothing
%>

HTH
Mikeal
 
Providing they have the cdonts script installed on their server.!!


--
95isalive
This site is best viewed..................
...............................with a computer

<%
Set MailObject = Server.CreateObject("CDONTS.NewMail")
attFile = "c:\attachments\StandardPolicy.txt" 'Replace this path
with the path of you file.
attName = "Policy.txt"
MailObject.From = "(e-mail address removed)"
MailObject.To = "(e-mail address removed)"
MailObject.Subject = "Subject Text Here"
MailObject.Body = "Body Text Here"
MailObject.AttachFile attFile, attName
MailObject.Send
Set MailObject = Nothing
%>

HTH
Mikeal
 
This looks like they have to have the file on their hard
drive. I need something that is going to run when they
hit the submit button that will email the file info to me.

Thanks for your help
-----Original Message-----
<%
Set MailObject = Server.CreateObject ("CDONTS.NewMail")
attFile
= "c:\attachments\StandardPolicy.txt" 'Replace this path
 
No, you generate the file form the information on the form.

set FSO = Server.CreateObject("scripting.FilesystemObject")
set myFile = fso.CreateTextFile("c:\shared\client_data_files\" &
request.form("LastName") & ".txt", true)
myFile.WriteLine(request.form("Field1") & Chr(9) & request.form("Field2")
& Chr(9) & request.form("Field3"))
myFile.Close

In the above example I have a form that has a field on it called LastName. I
then create a file named 'LastName.txt'. Then you write the file with any of
the forms information. The & Chr(9) & string is for a tab delimited
file.

Then you use the initial code I gave you to attach the file you just
created. I have my own server so I am actually writing the file to my C
drive. You do not have to do this. You can write the file to a directory on
your web site. The only problem is that you hosting company needs to grant
write permission to your site.

Mikeal
 
Gotcha!!!
I'll give it a shot....thanks alot for the help.
-----Original Message-----
No, you generate the file form the information on the form.

set FSO = Server.CreateObject ("scripting.FilesystemObject")
set myFile = fso.CreateTextFile
("c:\shared\client_data_files\" &
 
Back
Top