Forum Moderators: coopster & phranque

Message Too Old, No Replies

Formmail.cgi question

Multiple email addresses?

         

jamiedm

8:40 pm on Jun 26, 2004 (gmt 0)

10+ Year Member



Hi,

I'm using formmail.cgi, and I would like to send the form results to the user as well as myself.

I am aware of the hidden tag, and how you enter email addreses seperated by commas to send to more than 1 email address. THat works fine.

However, is there a way to send the form results to myself & to an email address specified by the user in a text box?

ie have a textbox with a label

"If you would like a copy, enter email address here"

calling the txtbox txtemail for example.

Thanks for any help, it's greatly appreciated.

Jamie

MichaelBluejay

6:16 pm on Jun 27, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I will assume you're using Matt's FormMail.

Matt's FormMail prevents spammers from hijacking your form to send out spam, and it does this by limiting the recipient of the message to be on your own domain. If you cc: the sender then FormMail has to allow the message to go to *anybody*, which means that you leave your script vulnerable to spammers. You can still have the cc: feature (I use it myself), you just have to understand the risk you're taking.

One way to keep spambots from finding your vulnerable script is to rename it. Spambots search the web for files named "formmail.cgi" and "formmail.pl", etc. If you rename your script to something not obvious (e.g., sendymailbooboo.cgi) then spambots won't be able to find it. Human visitors can still find it, but most spammers find scripts with bots, not by personally visiting the pages themselves.

Assuming you're willing to remove the anti-spam security feature, then first rename your formmail script, and also rename the action in the <FORM> tag.

Then find this line in your script: print MAIL "To: $Config{'recipient'}\n";

and add this line under it: print MAIL "Cc: $Config{'email'}\n";

More experienced Perlheads might want to review this message and make sure I didn't make a mistake somewhere. I'm not he biggest Perl veteran.

jamiedm

7:13 pm on Jun 27, 2004 (gmt 0)

10+ Year Member



I am using Matt's script, version 1.92. It's named webmail.cgi.

However, the line of code you suggested I look for was not in my code.

If someone things they may be able to help me on this, I'm concerned about 2 things:

1. CC'ing the user via an email address they enter in a textbox

2. Making a pulldown and txt box required fields (tried the required command, doesn't seem to want to work.

I tried posting the code but it must be too bigg for the forum. If someone can help, I could email it to them.

Thanks for any help on this.

Jamie

Zipper

7:14 am on Jun 28, 2004 (gmt 0)

10+ Year Member



i might be able to help u if you could be a bit more clearer on the second point. my e-mail is on the profile i think

jamiedm

12:44 am on Jun 29, 2004 (gmt 0)

10+ Year Member



OK, first off, allow me to explain the situation.

The form I have has people do 3 things:

1. Select their name from a pulldown menu
2. Make radio button selections
3. Enter a number in a textbox at the bottom

with reset and submit buttons at the bottom.

Now, I would like for steps 1 and 3 to be required. (ie a required pulldown and text box) with the option for users to input their email address in a text box (which i would add) so that they will also get the email generated from the script.

Could not find an email, so if you think you could still help me, I would really appreciate it.

Thanks,

Jamie

MichaelBluejay

4:45 am on Jun 29, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



The line I referred to is line #393 in Matt's FormMail.pl, v. 1.92.

Zipper

10:24 pm on Jun 29, 2004 (gmt 0)

10+ Year Member



just stiky'd you.
pull down menu with 'their' names? guess i'll have to take a look at it.