> Eh, first, I thought it could be done in HTML or javascript. Second, I
figured it could be done in just a few lines of code if it was in php or
cgi. But I guess no one will help me, so I'll spend hours trying to learn
php just so I can use it on one form....great.
Well, it's a little more than "just a couple of lines" as you need to check
for existance of an address and so on...
try this:
<?php
// Here is a modified script form:
//
http://www.stargeek.com/scripts.php?script=12&cat=blog
$mail_from = "mr*****@pandg.com";
$mail_to = $_POST['to_email'];
$mail_subject = "Contact Form";
if ($_POST)
{
if($_POST['from_email'])
{
if(mail($mail_to, $mail_subject, $_POST['from_name']."\n".$_POST
['from_mail']. "\n". $_POST['userMessage']))
{
$html = 'Your email was sent';
}
else
{
$html = 'There was an error';
}
}
}
else
{
$message = "<textarea name='userMessage'></textarea>";
$name = "<input type='text' name='from_name'>";
$reply = "<input type='text' name='from_email'>";
$addylist = "<select name='to_email'>/n";
$addylist = $addylist."<option selected value='mr*****@pandg.com'>Mr.
Clean</option>";
$addylist = $addylist."<option va***********@columbus.rr.com'>Nathaniel
Maier</option>";
$addylist = $addylist."</select>";
$send = '<input type="submit" name="submit" value="Send">';
$html = "
<p>
To Contact Stargeek:
</p>
<form action=\"$PHP_SELF\" method=\"post\">
<table class=\"bodyBlack\" border=\"0\" cellspacing=\"5\">
<tr>
<td>Your Name:$name</td>
</tr>
<tr>
<td>Your Email:$reply</td>
</tr>
<tr>
<td>Select Person to send to: $addylist</td>
</tr>
<tr>
<td colspan=\"2\" align=\"center\">Additional Message
</td>
</tr>
<tr>
<td colspan=\"2\" align=\"center\">$message</td>
</tr>
<tr>
<td colspan=\"2\" align=\"center\">$send</td>
</tr>
</table>
</form>
";
}
?>
<html>
<head>
</head>
<body>
<?=$html?>
</body>
</html>