Click to See Complete Forum and Search --> : asp form


djdavedawson
12-02-2003, 04:00 PM
How can I get my script to email to an input type from the form?

strRcpt = "email@websit.com"

This is how it is now.

simflex
12-02-2003, 07:51 PM
can you be clearer on what you want?

djdavedawson
12-04-2003, 10:49 AM
The form I have right now, always sends the results to me. I would like to set up my from to send the results to whatever email address is typed into the form field in the form. The script specifies the recipient like this:

strRcpt = "ddawson@vailresorts.com"

It needs to be changed to specify the value of the email addres input type field in the form. I'm not sure how to accomplish this. The end result would be that the form sends to whatever address the visitor types in.

Thank you for your time

VB.NET
12-10-2003, 02:52 AM
I just wrote a similar page in ASP. here is some of my code to get you started. The basic idea is to use the CDO object to send email to the user-specified address (which you can grab with Request.Form)

<%
if request.Form("email_email") <> "" then 'If submitting
theSchema="http://schemas.microsoft.com/cdo/configuration/"
Set cdoConfig=server.CreateObject("CDO.Configuration")
cdoConfig.Fields.Item(theSchema & "sendusing")= 2
cdoConfig.Fields.Item(theSchema & "smtpserver")=<INSERT YOUR SMTP SERVER HERE>
cdoConfig.Fields.Update

set cdoMessage=Server.CreateObject("CDO.Message")
cdoMessage.Configuration=cdoConfig
cdoMessage.From=request.Form("email_email")
cdomessage.Sender = request.Form("email_name")
cdoMessage.To=request.form("email_to")
cdoMessage.Subject= request.Form("email_subject")
cdoMessage.TextBody= request.Form("email_message")
cdoMessage.Send

Set cdoMessage=Nothing
Set cdoConfig=Nothing

else 'if not submitting
%>
<html>
<body>
/* create form and stuff, name the input boxes */
</body>
</html>

djdavedawson
12-10-2003, 09:21 AM
Thanks everyone