I have a simple form with the follow fields:
Name:
Email Address:
Text:
and a group of radio buttons:
BB01
CC02
DD03
EE04
If the internet user selects a radio button with the value of BB01. Then I want the email sent to abc@zz.com
If the internet user selects a radio button with the value of CC02. Then I want the email sent to def@zz.com
So on and so forth.
I have the form working just fine for one recipient and even have the CC and BCC working. But anyone know about to affect the recipient based on the content selected?
Thanks for your help.
Gerald
hi,
can you set the "value" of the radio button to the email address of the recipient you want.
ie: for radio button 1, the CHECKED value is: recp1@domain.com
and then instead of having the recipient field hidden (which is called say, "recipient"), have the radio buttons CALLED "recipient"?
would this work?
Regards,
William
So would you put the email form (to, subject, from, message) on a page with logos above/beside it and then when people click on these logos they get appended to the "To" field. They then fill in their message and hit send?
Just clarifying that is what you are doing, not totally sure I get what you want.
1. Put all the selected addresses in an array.
2. Write a simple function that uses the mail() [php.net] function to send the mail. "Globalize" [php.net] the variables that contain the subject and message.
3. Use the function array_walk() [php.net] to apply each address to your function (along with the subject and message).
T