The form would have to send the info via action attribute to a page which has a scripting language.
PHP is a good example.
Page 1: The HTML Page
HTML Code:
<form action="process.php" method="post">
...stuff
<input type="submit" name="send_email" />
</form>
Page 2: The PHP Page
PHP Code:
<?php
//Who is this email going to be sent to?
$to = 'youremail@gmail.com';
//What is the email's subject
$subject = 'Thank You For Contacting Us';
//What is the email's message
$message = 'This email is to inform you that we...';
if(isset($_POST['send_email'])) //User submitted form
{
if(mail($to,$subject,$message))
{
echo '<p>We have received your message. Thank you for contacting us!</p>';
}
else
{
echo '<p>There was a problem contacting us...try again later.</p>';
}
}
else //The user is visiting the page but the form wasn't submitted
{
echo '<p>Please submit the form before viewing this page.</p>';
}
?>
This is just a basic script, it will send an email after the form is submitted and thats all.
You can google the phrase "PHP Contact Page Tutorial" to get much better examples.
Bookmarks