Jump to content

Simple text entry / email


slade8200
 Share

Recommended Posts

I'm trying to create a page that has a few fields where a user enters information and once a submit button is hit, an email is generated with the info and sent to a specific email address. I so far have this:

<form method="get" action="regform.asp">First Name:    <input type="text" name="fname" /><br /><br />Last Name:    <input type="text" name="lname" /><br /><br />Address:    <input type="text" name="address" /><br /><br />Phone #:    <input type="text" name="phone" /><br /><br /><input type="submit" value="Submit" /></form><%Set myMail=CreateObject("CDO.Message")myMail.Subject="Sending email with CDO"myMail.From="Registration"myMail.To="x@xcommunications.com"myMail.TextBody="A new person has submitted information."myMail.Sendset myMail=nothing%></body></html>

How do I get the variables fname, lname, etc. into my email; and what action "sends" the email? Also, what is the purpose of the "set myMail=nothing" line? Thanks.

Link to comment
Share on other sites

  • 4 weeks later...
I'm trying to create a page that has a few fields where a user enters information and once a submit button is hit, an email is generated with the info and sent to a specific email address. I so far have this:
<form method="get" action="regform.asp">First Name:    <input type="text" name="fname" /><br /><br />Last Name:    <input type="text" name="lname" /><br /><br />Address:    <input type="text" name="address" /><br /><br />Phone #:    <input type="text" name="phone" /><br /><br /><input type="submit" value="Submit" /></form><%Set myMail=CreateObject("CDO.Message")myMail.Subject="Sending email with CDO"myMail.From="Registration"myMail.To="x@xcommunications.com"myMail.TextBody="A new person has submitted information."myMail.Sendset myMail=nothing%></body></html>

How do I get the variables fname, lname, etc. into my email; and what action "sends" the email? Also, what is the purpose of the "set myMail=nothing" line? Thanks.

Since your action is pointing to regform.asp your code for sending the email needs to be there. You will pull the information from the URL, when you submit the page should look something like this.regform.asp?fname={something}&lname={something}&address={something}&phone={something} - this is determine by your method using get.You then need to pull that information using something like this on the regform.asp page.<%Dim fname, lname, address, phonefname = request.querystring("fname")lname = request.querystring("lname")address = request.querystring("address")phone = request.querystring("phone")Set myMail=CreateObject("CDO.Message")myMail.Subject="Sending email with CDO"myMail.From="Registration"myMail.To="x@xcommunications.com"myMail.TextBody="A new person - " & fname & " " & lname &" - has submitted information."myMail.Sendset myMail=nothing%>
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...