Free HTML Contact Form Code

Create free online HTML contact forms as easy as 1-2-3 using simple HTML contact form code or the 123ContactForm HTML contact form builder.

Free HTML Contact Form Code

HTML contact forms are one of the most common components in most websites or blogs. They are becoming highly popular on the rest of web as well, for example on Facebook pages and in email newsletters. Today we are going to take a look at how to generate our own HTML contact form code. It is a nice and simple HTML contact form. To make it work properly, we will add a PHP script to the HTML contact form code.

Creating fully functional HTML contact form code with PHP script processing


Step 1: Create the file with the HTML code of the contact form

Firstly we will create the HTML form which will display basic form fields. It will ask users to submit their Name, Email Address and a Message.

<form id="contact_form" action="#" method="POST" enctype="multipart/form-data">
	<div class="row">
		<label for="name">Your name:</label><br />
		<input id="name" class="input" name="name" type="text" value="" size="30" /><br />
	</div>
	<div class="row">
		<label for="email">Your email:</label><br />
		<input id="email" class="input" name="email" type="text" value="" size="30" /><br />
	</div>
	<div class="row">
		<label for="message">Your message:</label><br />
		<textarea id="message" class="input" name="message" rows="7" cols="30"></textarea><br />
	</div>
	<input id="submit_button" type="submit" value="Send email" />
</form>						

Step 2: Add PHP functions to our contact form HTML code

Now that we have the HTML contact form code ready, we will just have to add the PHP script that will process it. Basically, the PHP script verifies if all of the fields of the HTML contact form were filled out correctly and displays an error message next to the input field if needed. Then it processes the data and sends it to your email.

Creating the PHP script requires basic understanding of PHP coding. You can still use our free HTML contact form code generator, that works like magic without any technical knowledge.

Check the image above to see how your form will look in the browser if you save the above HTML contact form code. To download the full code of the HTML contact form with the PHP script, click here.

Free Online HTML Contact Form Code Generator

Get more features by using our drag & drop HTML contact form code generator


That's it, we generated fully functional and simple HTML contact form code. You can build more advanced HTML contact forms with our free HTML contact form code generator. Among the features, you've got: All of these features and many others can be implemented with our simple HTML contact form code generator. Don't hesitate to try it out!
By signing up, you're agreeing with the 123ContactForm Terms of Service