if you only have a couple of people you could use radio buttons
Code:
<form name="frmEmail" action="sendEmail.php" method="post">
<label>
<span>Receipient:</span>
<input type="radio" name="ureceipient" value="jack"> Jack
<input type="radio" name="ureceipient" value="frank"> Frank
<input type="radio" name="ureceipient" value="mary"> Mary
</label>
<label>
<span>Message:</span>
<textarea cols="10" rows="5" name="ucomment"></textarea>
</label>
<input type="submit" name="sumbit" value="Send Email">
</fieldset>
</form>
if you would prefer a drop down you can do
Code:
<form name="frmEmail" action="sendEmail.php" method="post">
<label>
<span>Receipient:</span>
<select name="ureceipient">
<option value="jack">Jack</option>
<option value="frank">Frank</option>
<option value="mary">Mary</option>
</select>
</label>
<label>
<span>Message:</span>
<textarea cols="10" rows="5" name="ucomment"></textarea>
</label>
<input type="submit" name="sumbit" value="Send Email">
</fieldset>
</form>
and sendEmail.php would look like
PHP Code:
<?php
// Define the email addresses for the specific names
$to = array(
"jack" => "jack@domain.com",
"frank" => "frank@domain.com",
"mary" => "mary@domain.com"
);
// Populate the email "to" field
$receipient = $to[$_POST['ureceipient']];
// Send Email
mail($receipient,'Subject','Message');
?>
if you wanted to send to multiple people at the same time, then that is doable too, just let us know and a script will be given. if you have any questions just ask, sorry for the very rough example
Bookmarks