Forum Moderators: coopster & phranque

Message Too Old, No Replies

Form/Email CGI

Recipient address based on content

         

gstory

10:24 pm on Jan 7, 2003 (gmt 0)

10+ Year Member



I am looking for a CGI or other information on how to create a web form that will be emailed back to me or another of my users based on it's content.
Explaining:

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

wruk999

10:26 pm on Jan 7, 2003 (gmt 0)

10+ Year Member



>> just posted it in your first one!

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

emailtools

10:25 pm on Jan 7, 2003 (gmt 0)

10+ Year Member



Just specify a hidden "to" field as your selectable option value.

Something like:
BB01 <input type="radio" name="recipient" value="xx@zz.com" checked>

gstory

10:41 pm on Jan 7, 2003 (gmt 0)

10+ Year Member



Sweet Idea and it worked just like I needed. Many thanks

Powdork

9:15 pm on Jan 12, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm looking for something similar. I want users to be able to click on as many logo images as they want with each one loading a recipients address so that users can send a message to as many different clients as they want. This will be my first from so go easy please:).
Thanks, Powdork

jatar_k

9:23 pm on Jan 12, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



doesn't sound like the easiest style of form to cut your teeth on ;)

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.

Powdork

11:49 pm on Jan 12, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Basically I want the user to be able to send the same message to multiple vendors at one time. They would select the vendors by clicking on their logos (the logo's border would then be highlighted to show its selected) then compose and send their message which would automatically be sent to the different addresses. I've only just begun the page but I uploaded it to give an idea. Its in my profile.

Powdork

12:58 am on Jan 17, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Ok, so now I'm getting somewhere. I've got it set up so that the addresses they check will be added to a field in a format that I can cut and paste the addresses into the send field and forward the message. I'd still like it to automatically send the message to the individual adresses if possible.

toadhall

5:11 am on Jan 17, 2003 (gmt 0)

10+ Year Member



If you're using PHP try this:

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

Powdork

5:30 am on Jan 17, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



What's PHP? ;)
Seriously, thats about what level I'm at with all this. I'm using a basic formmail provided by my hosting provider. I got all the address into one line by giving each checkbox the same NAME with VALUE="emailaddress" Maybe I could just change it to VALUE="sendmailto:emailaddress". Basically, I've got the page pretty much where I want from a users standpoint, but it will still require a bit of work on my part:(.
Thanks for the help
Powdork