المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : How to Select email recipient from drop down or radio button list



bahattab
09-03-2008, 01:16 PM
Select email recipient from drop down or radio button list

I have no idea if what I am looking for is even possible but I'll try to explain it.

What I want to do is have a drop down menu or radio buttons, where the user can select who the email is sent to. My site is an rpg so I need to make email forms for monthly reports. Since more than one person would be recieving different reports this would be helpful.

Which ship are you reporting for?
USS Destiny - sent to CO's email
USS Nova - sent to CO's email
USS Victory - sent to CO's email






Yes you can use a drop down to email different recipients, if you were using a PHP page (not soley, but an option).




<select name="recipient">
<option value="destiny">USS Destiny</option>
<option value="nova">USS Nova</option>
<option value="victory">USS Victory</option>
</select>

//php
switch ($_POST['recipient']) {
case "destiny":
$recipient = "emaila@email.com";
break;
case "nova":
$recipient = "emailb@email.com";
break;
case "victory":
$recipient = "emailb@email.com";
break;
}


The first piece of code is a sample drop-down.
The second piece shows how you could assign different email addresses to the PHP mail function before sending a email.



http://forums.hostrocket.com/showthread.php?t=18504