How to Write HTML Code for Someone to Subscribe to Newslettersby Brandy Alexander
As a website creator, consider adding a newsletter subscription feature to your pages. This website element invites users to receive your mailings and you get notified when interested parties participate. In this way, you can build a mailing list that allows you to communicate your messages to a dedicated audience and it keeps these viewers interested in you site. Using HyperText Markup Language (HTML), write the code that allows your visitors to subscribe to your own newsletters.
Open a web page file in your text editor. Place your cursor in the area where you want to place the prompt for visitors to subscribe to your newsletter.
Type in opening and closing “<h1></h1>” header tags. Type content between these elements to tell the viewer what the prompt is for. For example:
<h1>Subscribe to My Newsletter</h1>
Enter a “<form>” tag. Inside the tag, set the “method” to “post,” the “enctype” to “text/html” and enter your email address after the “action” entry. For instance:
<form method=”post” enctype=”text/html” action=”mailto:email@example.com”>
This code line sends any subscription requests to you as an email message.
Type in an “email” entry. Enter an “<input>” tag with the “name” assigned to “email” and the “type” set to “text” as such:
Email <input name=”email” type=”text”>
This HTML line asks the user for his email address and provides a text field where he may enter the information.
Create a “Submit” button to allow the user to deliver her information to you by entering the following line of code:
<input type=”submit” value=”Submit”>
Type in an ending “</form>” tag to complete the code. Save your file when done.