Categories

How to create an ASP contact form in HTML

Template-help.com Team November 15, 2010
Rating: 4.3/5. From 8 votes.
Please wait...

Let’s learn it at an example. Let’s say one of your pages has a code as follows:

The layout of the contact form can look like this:
On your server you should have a script that will actually generate and send e-mails to a certain e-mail address. A sample of this contact.asp script you can download here. The ASP script is supported on the most of Windows-based hosting servers. Our html form has two tags: opening
and closing
. For the form to pass data to our contact.asp we need to specify five attributes within this tag:
“Id” attribute is a standard for all forms; – “Method” attribute specifies what method is using for sending contact form letters; – “Target” attribute specifies how the message which is telling us that letter was sent will be appear; – “Action” attribute is telling us that we are using ” contact.asp” file as a script for sending letters; – “Name” attribute is a value which is used in contact.asp file. The form we are working with has two text input fields and one text area. The original contact form already has two of them: name=”name”, name=”mail”, you will also need to set the third name value into the message text area – name=”message”. The resulting script should look like this:

where you can see the code for the Reset button:
And the code for Submit or Send button:
Now lets take one of the templates which doesn’t have the CSS structure and uses tables. Here is the default code from the contact form:




clear send
You have to insert the same values as in example above, so let’s see how the result code should look like:




clear send
Now let’s take a look at the contact.asp file, what do we need to change here. Open it with your php editor and find the following lines: ‘—-Settings———– subj = “Contact form from your site” – (here you can change heading message which you will receive in the letter from guest) mail_from = “admin@tsie.loc” – (here you need to put your website mail address ) mail_to = “andy@template-help.com” – (here you need to put your own email address) smtp_server = “localhost” – (here you need to put SMTP server name of your server ) smtp_port = 25 – (here you need to put SMTP port of your server) If you don’t know these settings, you need to contact your hosting provider for the details.
This entry was posted in Working with HTML and tagged contact form, forms, HTML. Bookmark the permalink.

Submit a ticket

If you are still unable to find a sufficient tutorial regarding your issue please use the following link to submit a request to our technical support team. We'll provide you with our help and assistance within next 24 hours: Submit a ticket