ASP Email Forms

G

Guest

Guest
Archived from groups: microsoft.public.inetserver.asp.general,microsoft.public.win2000.advanced_server (More info?)

Does anyone see anything OUTRIGHT that I can fix on this....I'm a
virgin ASP'er and I'm trying to produce an email from a form
submission button....This is just my little "template" for future use
(I have several pages that will require online submission)

I'm not getting any emails and I'm not even getting the confirmation
page that I defined....ANY HELP WOULD BE GREAT....

Thanks in advance

Code is following;
*****

<% option explicit %>

<%

If Request.Form("btnSubmit").Count >0 Then

strMessage ="This is a test"
strMessage = strMessage & "Name: " & Request.Form("FirstName")
strMessage = strMessage & "Name: " & Request.Form("LastName")
strMessage = strMessage & "Name: " & Request.Form("Address1")
strMessage = strMessage & "Name: " & Request.Form("Address2")
strMessage - strMessage & "Name: " & Request.Form("City")
strMessage = strMessage & "Name: " & Request.Form("State")
strMessage = strMessage & "Name: " & Request.Form("PostalCode")
strMessage = strMessage & "Name: " & Request.Form("Country")

'create email object and insert certain values
Set ObjMail = Server.CreateObject("CDONTS.NewMail")
objMail.To = "dmiller"
objMail.From = "Test"
objMail.Subject = "Test Email 5-25-04"
objMail.Body = strMessage

'send email and then clean up
objMail.Send
Set objMail = Nothing

'redirect to confirmation page
Response.Redirect "confirm.asp"

End If
%>

<html>
<head>
<title>Coachweb</title>
</head>
<!-- #INCLUDE VIRTUAL="/_borders/top_nav.asp" -->

<FORM METHOD=POST ACTION= "submit_email" name="test_email">

<PRE><B>Membership Options</B>
<INPUT TYPE="radio" NAME="MembershipType" CHECKED
VALUE=1> 1 Year Prestige Membership ($29.99)
<INPUT TYPE="radio" NAME="MembershipType"
VALUE=2> 2 Years Prestige Membership ($49.99)
<INPUT TYPE="radio" NAME="MembershipType
VALUE=3> 1 Year Ambassador Membership ($39.99)
<INPUT TYPE="radio" NAME="MembershipType
VALUE=4> 2 Years Ambassador Membership ($59.99)
<INPUT TYPE="checkbox" NAME="SendBroch"
VALUE="Yes"> Please send me more information on the different
valuable membership options.

<B>Your Mailing Address:</B>

Name:<INPUT NAME="FirstName" size=16> <INPUT NAME="LastName" size=27>
Address:<INPUT NAME="Address1" size=43>
<INPUT NAME="Address2" size=43>
City:<INPUT NAME="City" size=15> State:<INPUT NAME="State" size=2>
Zip:<INPUT NAME="PostalCode" size=10>
Country:<INPUT NAME="Country" size=20>

<B>Your Credit Card Information:</B>
Type:<SELECT NAME="CardType">
<OPTION SELECTED>Visa
<OPTION>MasterCard
<OPTION>Discover
</SELECT>
Name:<INPUT NAME="CardName" size=25>
Number:<INPUT NAME="CardNumber" SIZE=20>
Expires:<INPUT NAME="CardExpDate" SIZE=7>

<INPUT TYPE="submit" VALUE=" Send "><INPUT TYPE="reset"
VALUE="Clear Form">

</PRE>
<input type="hidden" name="mode" value="submit">
</FORM>
</HTML>
<!-- #INCLUDE VIRTUAL="/_borders/bottom_nav.asp" -->
 
G

Guest

Guest
Archived from groups: microsoft.public.inetserver.asp.general,microsoft.public.win2000.advanced_server (More info?)

> Does anyone see anything OUTRIGHT that I can fix on this

What do you mean by fix? Is there a problem?

The first thing that hits me is that you are using CDONTS.NewMail for some
reason. This object has been deprecated for a variety of reasons, and
should be replaced with CDO.Message. (In fact you can't even use
CDONTS.NewMail on Windows Server 2003.) See http://www.aspfaq.com/2026

--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/