Solved

Creating a very simple email register textbox and button

Posted on 2008-06-17
5
179 Views
Last Modified: 2013-11-19
I would like to know the code i could use to have  a textbox on my website that a user can put in their email address in, click on a button that says "register"  and then have the email of the user sent to another email account of my choosing.

The idea is to create a registration list of emails that will be stored in an email that I own.

The only requirements i need is

1. A text box
2. A button that sends the info found in the text box to a email
3. That it works in xhtml 1.0 stict and css


0
Comment
Question by:djmichaelray
  • 3
  • 2
5 Comments
 
LVL 82

Expert Comment

by:hielo
ID: 21805703
Save the code below as hielo.asp and try it. You will need to provide a valid email address.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
</head>
<body>
<%
If "Register" = Trim(Request.Form("register")) Then
	Set myMail=CreateObject("CDO.Message")
	myMail.Subject="Sending email with CDO"
	myMail.From="mymail@mydomain.com"
	myMail.To="someone@somedomain.com"
	myMail.TextBody=Request.Form("email")
	myMail.Send
	set myMail=nothing
	Response.Write("<h1>Thank You</h1>")
Else
%>
<form action=<%=Request.ServerVariables("SCRIPT_NAME")%>' method="post" onsubmit="if(email.value==''){alert('Please provide email');return false;}">
	<div>
		<div>Email: <input type="text" name="email" id="email" /></div>
		<div><input type="submit" name="register"  value="Register"/></div>
	</div>
</form>
<%
End If
%>
</body>
</html>

Open in new window

0
 

Author Comment

by:djmichaelray
ID: 21805828
thanks alot looks great. One last question.  Will i encounter anyproblems implementing a asp page insteam of html into my current css design
0
 
LVL 82

Accepted Solution

by:
hielo earned 500 total points
ID: 21805866
It makes not difference if the page is html or asp. The potential problems you would encounter would be based on the HTML content that the browser sees/receives. An ASP file contains SERVER code AND (typically) HTML code. The browser does NOT see/receive the SERVER code, so the ASP code will not affect your page. The only thing that will affect your page is the output of the ASP page - meaning the overall data that the asp sends to the browser.
0
 

Author Closing Comment

by:djmichaelray
ID: 31468061
Thanks alot for the attension to deatil in your explanation
0
 
LVL 82

Expert Comment

by:hielo
ID: 21805950
You are welcome!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preface This is the third article about the EE Collaborative Login Project. A Better Website Login System (http://www.experts-exchange.com/A_2902.html) introduces the Login System and shows how to implement a login page. The EE Collaborative Logi…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now