Welcome to WebmasterWorld Guest from 22.214.171.124
I have been a long time user of NMS FormMail (a popular drop in replacement for Matts original script).
For the first time, however, I am in desparate need of the ability to Carbon Copy other folks as selected by a drop down menu and/or checkbox array.
There is no provision in the script to do this, for fear of abuse, which of course makes sense, except that I have limited the recipient field to only those domains that are allowed to receive the form data.
My exact application is this, a user fills out a request for information. The form directs to a "recipient_alias" which is a simple email Forwarder, that forwards the information request form to 3 of my vendors, who respond to the client with their pricing.
However, the user (often an end client, sometimes a sales rep) needs to be able to select from a drop down or check box array, to Carbon Copy one or more of the sales reps, depending upon the product information desired.
I am pretty sure I'd have no problem setting up the form fields, but... NMS Form Mail v3.14 (latest and final) does not support "CC".
I am hoping that someone who is perl savvy could give me a line of code to insert as a solution.
As a reference, there was nearly the exact same post AND solution back in 2006, at this link:
HOWEVER.... the solution proposed was for Matts original script. I can't locate a similar place to insert the code snippet, in the final NMS replacement version.
Thanks very much, in advance, for any light shed!
and you'll be close to the solution. If they use smtp to send the email, it'll be different. For that, I'd have to look at the script, which I'm happy to do if you tell me which version you're running and paste the changes you've made to the script.
open(SENDMAIL, "¦/usr/sbin/sendmail -t")
The word "sendmail" appears in many places in the script, and the word "recipient" appears in twice as many.
I can post the script here if that does not violate the forum rules. Since I am not a programmer, it would great if a line or two of code could be dropped in with a little instruction.
Thanks in advance for any help!
yes - there are easy ways to do what you want.
i would not recommend using them.
if you put bare email addresses in a selection element of the form it will be scraped and the mailbox owner will be spammed.
also, if you don't properly validate your form input the script will be abused by spammers to send email using your cc: list vulnerability.
the nms formmail script is designed to limit your exposure to these issues.
doing it right is not one or two lines of code.
I agree and understand about not putting email addresses directly in the form code, which is why I use the "recipient_alias" feature of Formmail to prevent that.
I also agree and understand about validating the recipients within the script, which is why I use the following settings within the code:
a) limit the number of total recipients to 5 (the 3 vendors, myself and the sales rep) ...the sales rep being the part i need help with
b) limit the domain allowed to send from, to my domain only
I recognize that unscrupulous spammers may find a way around these validations, and I am willing to put in any other possible validations that may be necessary, to gain the advantage of being able to CC the specific agent for that account. I just don't know how.
I would be most appreciative of any assistance in this regard.
I would be perfectly fine having those sales reps be 'recipients' (TO) instead of (CC)... however... I need to be able to have the sender choose which sales rep to send to.
Formmail allows the use of one alias, so for example, I have it set as follows.
myalias = email@example.com where firstname.lastname@example.org is a forwarder to email@example.com,firstname.lastname@example.org and email@example.com
If I have 6 sales reps how do I have a drop down or checkbox system so that rep is also a "TO" recipient, as suggested. As you can see, I cant just add them to the forwarder, or all sales reps would get all emails.
Thanks again for your interest and assistance.
%recipient_alias = (
'joe' => 'firstname.lastname@example.org',
'tom' => 'email@example.com,firstname.lastname@example.org',
'rob' => 'email@example.com',
'pete' => 'firstname.lastname@example.org',
'matt' => 'email@example.com',
'john' => 'firstname.lastname@example.org'
the selection/radio form input element should use name="recipient" and value="alias".
i haven't looked to see if that script would support multiple selections.
The problem is the script won't allow more than one alias to be selected (the first main alias to hit the vendors, and the second alias for the reps).
However, you did just give me an idea... a bit of a round-a-bout but I think it will do the job.
I will drop the HIDDEN Recipient alias altogether, and instead ...make the same group of aliases as you show, but EACH one will go to its own unique Forwarder. Then, EACH Forwarder would include only that rep PLUS, the various vendors.
I ***think*** that should achieve the desired result, do you concur? I will also post the result, in case a future poster needs to know as I did.