Forum Moderators: coopster & phranque

Message Too Old, No Replies

NMS Formmail - Multiple Recepients

Use of selection box to allow selection of recepient

         

gldweb

9:03 pm on Apr 29, 2005 (gmt 0)

10+ Year Member



I was wondering if it was possible, using NMS Formmail, to create a form with a selection list, i.e., drop down menu, to select a recepient for the contact form be sent to. I want to be able to retain the ability to hide the actual recepient email address and not display it.

Thanks

balam

5:35 pm on May 1, 2005 (gmt 0)

10+ Year Member



Easily done!

In your webpage form, you would need to put this:


<select name="recipient" size="1">
<option>Select recipient</option>
<option value="1">ME</option>
<option value="2">YOU</option>
<option value="3">HIM</option>
<option value="4">HER</option>
</select>

In FormMail.pl, you would need to put this:


%recipient_alias = (
'1' => 'me@example.com',
'2' => 'you@example.com',
'3' => 'him@example.com',
'4' => 'her@example.com'
);

gldweb

3:38 pm on May 2, 2005 (gmt 0)

10+ Year Member



That is simple - Thanks!

Just a quick follow-up, would I also need to include all of the email addesses within "@allow_mail_to" in the formmail?

Thanks

balam

4:07 am on May 3, 2005 (gmt 0)

10+ Year Member



Nope, no need to add them. This is from the README file:

The recipients in %recipient_alias are automatically added to the allowed recipients list, so there's no need to list them all in @allow_mail_to as well.

Cheers!