473,386 Members | 1,752 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

ASP Email Forms

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" -->
Jul 19 '05 #1
1 1438
> 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/
Jul 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

88
by: Mike | last post by:
Is there a way to determine what a user's default email client is? I read a post from 3 years ago that said no. I guess I'm hoping something has come along since then.
1
by: Keith | last post by:
I'm sending a email via Access 2000 and don't have a problem with the basic format. What I want it to automatically grab the email of the tech and insert it in the TO. I have a combo box which...
4
by: acni | last post by:
I have the following peice of code to try and send an email to selected contacts in my form.The problem is this line: StrStore = DLookup("", "qrySelectEmail", "??????") This looks up the email...
3
by: Kenneth Farmer | last post by:
Several of my websites are getting hosed by automated scripts that insert all kinds of jiberish into the forms and newsletter sign-up fields. Sometimes I get a hundred an hour. I noticed the...
3
by: Siv | last post by:
Hi, A little while ago I wrote a small program that allowed the user to view products from a database. The database holds the details of the products which can be viewed via a form and...
36
by: Liam.M | last post by:
hey guys, I have one last problem to fix, and then my database is essentially done...I would therefore very much appreciate any assistance anyone would be able to provide me with. Currently I...
0
by: Sister Ray | last post by:
I'm trying to create a simple form that sends an email using my company's exchange server. I'm using the System.Net.Mail Namespace of the .net framework 2.0. I've googled everywhere and i think my...
4
by: Tony M | last post by:
VS 2005 - XP media - VB .net - winforms - .net 2.0 Just trying to send an email, here is the code and the error message that I get. I can't figure out how to fix it?
0
colinod
by: colinod | last post by:
Does anyone know if you can send an email from Access using the stationary set in outlook. I have a form that sends the email but it only opens a blank email, it would be great if it opened using...
4
by: zufie | last post by:
I have a main form containing a command SEND button that prompts an email form to pop up. The email address(es) that are supposed to appear on the email form are those corresponding to the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.