Solved

Creating a very simple email register textbox and button

Posted on 2008-06-17
5
178 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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

CSS is a visual language used to classify objects and define rules about how they should be displayed. CSS skills aren’t restricted to developers anymore, there is a big benefit to having a basic understanding of the language, regardless of your occ…
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
In this tutorial viewers will learn how to style a decorative dropcap for the first letter in a paragraph using CSS. In CSS, create a new paragraph class by typing "p.fancy": Then, to style only the first letter of the first sentence, include the ps…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

747 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

11 Experts available now in Live!

Get 1:1 Help Now