Ok guys, I have a form I want to email the data to my email addess. There are three inputs, two text and one text area. On submit I would like it to display a thank you page. Whenever submit is clicked, I get a script error(thank you page never shows) and the hotmail pops up. I would like the form to just send the email without a pop up and go straight to the thank you page. Here is the code:

<form id="getquote" action="maileto:me@gmail.com" method="Post" enctype="multipart/form-data" name="form1" onSubmit="return location.replace(thankyou.html)">
<table class="no_class" cellspacing="0" cellpadding="0">
<td style="width:265px;">
<div class="form"><input type="text" name="yourname" value="your name" onFocus=value="" onblur=value="your&nbsp;name"></div>
<div class="form"><input type="text" name="email" value="e-mail" onFocus=value="" onblur=value="e-mail"></div>
<td >
<textarea rows="20" cols="50" name="message" onFocus=value="" onblur=value="message:">message:</textarea><br>
<br style="line-height:7px;">
<input type="submit" value="Get Quote!" onClick="parent.location='mailto:lancerayburn@gmail.com'; replace(thankyou.html)" style="margin-left:140px"><input type="reset" value="Reset" style="margin-left:27px"><br>

Thanks in advance for any help.

9 Years
Discussion Span
Last Post by Roebuc

Well mailto links launch the viewer's default email client. It doesn't actually send an email, you would need an emailer in PHP such as the one in the PEAR package for example if you would like an email form.


Hey Mate,

Using the mailto action isn't a good idea because it relies on the local e-mail software, which may not be set up correctly. There's no way to test for it either.

Using a server side language like PHP, or a pre-existing CGI on your hosting provider is the more robust option for a variety of reasons.

Also, may I suggest you get rid of the onblur/onfocus from your form fields, as they will get very annoying very quickly - it'll wipe the email addy if you refocus!

Mick :)


I thought there was a way around php, I guess not. Alright, thank you guys.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.