Home arrow Programming arrow Webdesign arrow Create a mailingform for your website using only HTML
Create a mailingform for your website using only HTML

Sometimes readers of your website want to contact you. If you don't have server side scripting knowledge (PHP, ASP, JSP etc.) or your webhost doesn't have server side scripting support (if you have a free host), you can't use a webform and you'll probably go for the next solution:
Posting your mailaddress on the site <a href="mailto:user[at]provider.com">webmaster</a>. This is not recommended because spambots are designed to follow those URL's. Additionally, this type or URL opens an external mailing program which can be very annoying for your readers.

Here is the solution: Create a mailingform using only HTML. Very easy to install / implement on your website.

HTML Mailing Form

The code

 
<form name="contact" method="post" action="http://www.universal.nl/scripts/mailto.exe">
<input type="hidden" name="sendto" value="EMAILADDRESS">
<input type="hidden" name="server" value="mail.universal.nl">
<input type="hidden" name="resulturl" value="http://www.RESULTURL">
<input type="hidden" name="subject" value="SUBJECT">
<p>Companyname<br/>
<input type="text" name="Companyname" size="66"/><br/>
Name<br/>
<input type="text" name="Name" size="66"><br/>
<input type="radio" name="Gender" value="Male">Male<br/>
<input type="radio" name="Gender" value="Female">Female<br/>
Emailadres<br/>
<input type="text" name="Mailaddress" size="66"><br/>
Telephone<br/>
<input type="text" name="Telephone" size="66"><br/>
Additional Information:<br/>
<textarea name="Information" cols="50" rows="5"></textarea></p>
<input type="submit" value="Send!"></form>

Copy and paste this code to your HTML-editor. Add optional input types/fields as you wish. Change the following values:
  • EMAILADDRESS. Change this to the mail address you want the mail to be sent to.
    Example: user@provider.com.
  • RESULTURL. Change this to the URL you want to redirect your users to after they've sent their message.
    Example: http://www.marcofolio.net/.
  • SUBJECT. Change this to the subject of your mail.
    Example: Mailingform from Marcofolio.net.

How it looks

Companyname

Name

Male
Female
Emailadres

Telephone

Additional Information:


*NOTE*: The form implemented above will not work, because there is no emailaddress entered. If you want to contact me, use the contact page or post it in the comments.

The result: Received mail

The following form contents were entered on DD MMMM YY
Date = DD MMMM YY HH:MM:SS
resulturl = http://www.marcofolio.net/
subject = Mailingform from Marcofolio.net
Companyname = Marcofolio
Name = Marco
Gender = Male
Mailaddress = user[at]provider.com
Telephone = NA
Information = For more tips and tricks, check:

http://www.marcofolio.net/

Ok, it's not the best looking mail you probably ever had, but it works and if you have brains you would understand it. Now you can contact your readers and answer them!

Update

I'm sorry to inform you that this script doesn't work anymore. The "mailto.exe" from Universal is now not handling any mail traffic. Let's try another solution.



Tags:  how to mail form programming webdesign HTML

Interested in this topic? You might enjoy another article I've written called

Did you like this article? Subscribe to my feed or email to keep updated on new articles.

Spread the word and submit to:
Reddit!Del.icio.us!Facebook!Technorati!StumbleUpon!Newsvine!Furl!Ma.gnolia!
Comments
Add NewSearchRSS
Leila - I can't get it?   | 81.193.190.xxx | 2007-10-09 18:40:37
Gravatar image Here's the message I have received after trying your code: The markup in the document following the root element must be well-formed.

Help? :lol:
Marco - re: I can't get it?   | 62.195.144.xxx | 2007-10-09 18:58:08
Gravatar image
Leila wrote:
Here's the message I have received after trying your code: The markup in the document following the root element must be well-formed.

Help? :lol:
I've just checked and tested the code and it works fine over here.

Please contact me and add your source code, so that I'll be able to help you.

Good luck.
pizzadebarr - guess how well it works on IE7   | 190.132.146.xxx | 2008-01-27 06:52:52
Gravatar image I've tried it on IE7 and the dumb browser tries to download "mailto.exe".

It works nicely on Firefox and probably it works on every other browser.

Thank you for the code.
Marco - Stupid IE7   | 62.194.187.xxx | 2008-01-27 09:48:28
Gravatar image Well, this article was posted before IE7 even existed. Works good on IE6 and indeed in Firefox.

I really don't like IE7. Or better: I don't like IE at all (Go FF and Opera!).
Prblems - form   | 68.199.20.xxx | 2008-06-08 21:34:39
Gravatar image hi i want to create a form for sending emails so please i need help with the code thanks the problem is i cant recieve the email to my account support@solutionpcs.com so wha should i do thanks
Read more...
Name:
Email:
  Gravatar enabled.
Website:
Title:
UBBCode:
[b] [i] [u] [url] [quote] [code] [img] 
 
 
:angry::0:confused::cheer:B):evil::silly::dry::lol::kiss::D:pinch:
:(:shock::X:side::):P:unsure::woohoo::huh::whistle:;):s
:!::?::idea::arrow:
 
Security Image
Please input the anti-spam code that you can read in the image.
Unsubscribe from e-mail notifications.
 
< Prev   Next >
Subscribe
Navigation
Search
Search:
          
Sponsors
   




Blogrush