Solved

Creating a very simple email register textbox and button

Posted on 2008-06-17
5
183 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Text too large in Chrome 17 65
Html split(text) 2 32
Validating number not work with decimal 4 29
bootstrap css color change 10 25
Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

726 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