Note: Make sure you use an email address on the server as you can't use an outside email address for security reasons. You can always use a forwarder to send it to an outside email address as well. Version 1 (No Validation)
<html>
<head> <title>FormMail Demo</title> </head> <body> <form action="http://www.mydomain.com/cgi-sys/formmail.pl" method="post"> <input type="hidden" name="recipient" value="youremail@here.com"> <input type="hidden" name="subject" value="FormMail E-Mail"> Whatever you want to say here<br /><br /> <input type="text" name="email" size="20" value="Visitor E-Mail"><br /> <input type="text" name="tellme" size="20" value="E-Mail Content"><br /><br /> <input type="submit" name="submit" value="E-Mail Me!"> <input type="hidden" name="redirect" value="http://yourdomain.com/redirecto.html"> </form> </body> </html> Version 2 (Javascript Validation)
<html> <head> <title>FormMail Demo</title> <script type="text/javascript"> function hgsubmit() { if (/^\S+@[a-z0-9_.-]+\.[a-z]{2,6}$/i.test(document.hgmailer.email.value) == false) alert ("Valid email address required."); else if (/\S+/.test(document.hgmailer.tellme.value) == false) alert ("Email content required."); else { document.hgmailer.submit(); alert ('Thank you!'); } } </script> </head> <body> <form action="http://www.mydomain.com/cgi-sys/formmail.pl" method="post" name="hgmailer"> <input type="hidden" name="recipient" value="youremail@here.com"> <input type="hidden" name="subject" value="FormMail E-Mail"> Whatever you want to say here<br /><br /> Visitor E-Mail: <input type="text" name="email" size="20" value=""><br /> E-Mail Content: <input type="text" name="tellme" size="20" value=""><br /><br /> <input type="button" value="E-Mail Me!" onclick="hgsubmit();"> <input type="hidden" name="redirect" value="http://www.mydomain.com/path"> </form> </body> </html> |
Powered by WHMCompleteSolution