scpirin wrote:
> How can I create a dropdown menu that offers different email addresses and
> when submit is clicked, emails the form results to the specified email
> address?
>
> I am pretty sure HTML itself won't do it. Am willing to incorporate ASP or
> PHP.
You are right. HTML won't do it.
In PHP, it would be something like this:
Form:
<form action="formhandler.php" method="POST">
<fieldset>
<legend>E-mail Form</legend>
<label>To: <select name="who">
<option value="a">Al</option>
<option value="b">Bob</option>
<option value="c">Chaz</option>
</select></label><br>
<label>Subject: <input name="what1"></label><br>
<label>Body:<br> <textarea name="what2"></textarea></label>
</fieldset>
</form>
formhandler.php:
<?php
$who = $_POST['who'];
if ($who == 'a') { $to = ''; }
else if ($who == 'b') { $to = ''; }
else ($who == 'c') { $to = ''; }
$subj = $_POST['what1'];
$body = $_POST['what2'];
if ( mail($to,$subj,$body) ) {
header('Location: thanks.html');
} else {
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<title>Error</title>
<body><h1>Error</h1><p>An unspecified error occurred.</p></body>
<?
}
?>
--
Toby A Inkster BSc (Hons) ARCS
Contact Me -
http://www.goddamn.co.uk/tobyink/?page=132