Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CGI script, takes information from the user and sends it to my email.

Status
Not open for further replies.

ghassanghellal

Programmer
Jun 23, 2003
18
GB
Need a CGI script to be able to receive a number of fields of information to my email such as name, telephone number, address, and message.
E.g. this start a new thread form. Something that takes information from the user and sends it to my email.
Thank you
 
faq219-364

This should get you going in the right direction.


haunter@battlestrata.com
 
Please do a search for your question before asking it...it saves everybody time! The archives in tek-tips are quite huge and most probably someone has already asked ur question


Thank you

Ramzi Saab :p
 
My website is not hosted on my own server. When I use ftp to upload to the server I don’t see a CGIbin. But I am told to place the formail.pl in the cgibin. So what do I do? I also downloaded the formail file. I get the formail.pl and the read me file. The formail.pl file appears as a notepad icon and when I open it I just see strange symbols. Why is that?
 
i am looking through the cgi code for the formmail.



i am told to place the following code in the CGI script
<input type=hidden name=&quot;recipient&quot; value=&quot;email@your.host.com&quot;>

my question is where abouts in the script do i place it. not very clear to me. is it in the code below where it says 'recipient','',....if so place in between the ''?

# Define the configuration associative array. #
%Config = ('recipient','', 'subject','',
'email','', 'realname','',
'redirect','', 'bgcolor','',
'background','', 'link_color','',
'vlink_color','', 'text_color','',
'alink_color','', 'title','',
'sort','', 'print_config','',
'required','', 'env_report','',
'return_link_title','', 'return_link_url','',
'print_blank_fields','', 'missing_fields_redirect','');
 
Instead of passing the email address ( which is what made this unsafe in thn first place ) at least place your email address in the code
'recipient','email to address to/from' i.e. your not so private address

HTH
Paul

It's important in life to always strike a happy medium, so if you see someone with a crystal ball, and a smile on their face ...
 
You should open a new thread for new questions, but anyway.

The hidden input field is something you place in your HTML when calling the script, and the script parses this out from the form data, and gives an email address for the script to work with.

The problem with this... if a spammer finds your formmail script configured like this they can hammer your mail program mercilessly. To prevent this, hard code the recipient address (which I assume will always be you) in to the formmail script, and that will stop spammers.

By your not so private address I meant not an account you use for private emails

HTH
Paul

It's important in life to always strike a happy medium, so if you see someone with a crystal ball, and a smile on their face ...
 
OK, lets help this gent out...

Answer a few questions so we are all on the same page.

What is your server type? (Unix,Linux,Win32[Windows2000,Windows NT, Windows2003])

Do you have or paid for a server that you can install scripts? or is this a free server like geocities.com?

Do you have any experience with programing?
Do you have any experience with HTML?

Is formail.pl the program you are using or a custom solution needed?

I promise we will solve your problem just work with us and give us a lot of information to work with. Thew more info we have the faster we can fix your problem.

Contact me, If that is required but I would rather all thinks are posted in the forum so others can learn.


haunter@battlestrata.com
 
What is your server type?
Windows 2000

Do you have or paid for a server that you can install scripts? or is this a free server like geocities.com?
Site is hosted with fasthosts.co.uk I pay a small yearly charge, £50

Do you have any experience with programming?
Not with CGI, its my first time at this language

Do you have any experience with HTML?
A little

Is formail.pl the program you are using or a custom solution needed?
Formmail.pl is the cgi I am using.

I designed a form in flash mx, that asks the user some questions like name, address, phone…. Also some check boxes. I then want to receive this in my email, with all the information they filled in.

So I have to customize the formmail.pl cgi code to work with my form. So I feel that I have to do something with this code below. I can paste all the cgi script I have if you want, but it would be really long!

# Define the configuration associative array. #
%Config = ('recipient','', 'subject','',
'email','', 'realname','',
'redirect','', 'bgcolor','',
'background','', 'link_color','',
'vlink_color','', 'text_color','',
'alink_color','', 'title','',
'sort','', 'print_config','',
'required','', 'env_report','',
'return_link_title','', 'return_link_url','',
'print_blank_fields','', 'missing_fields_redirect','')
 
Code:
%Config = ('recipient','','
your@email.address'
Code:
,'',
  'email','',            'realname','',
  'redirect','',         'bgcolor','',
  'background','',       'link_color','',
  'vlink_color','',      'text_color','',
  'alink_color','',      'title','',
  'sort','',             'print_config','',
  'required','',         'env_report','',
  'return_link_title','','
Where you'd like to return the user to
Code:
','',
  'print_blank_fields','', '
if there's missing fields, where you'd like to redirect the user[/code]','')
[/code]

Where did you get formmail.pl from?

--Paul

It's important in life to always strike a happy medium, so if you see someone with a crystal ball, and a smile on their face ...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top