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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Send email using cgi 1

Status
Not open for further replies.

shruti18

MIS
Jun 22, 2005
30
US
Hello
I am trying to write a form which sends email on the basis of selection made in the drop down item of one the form fields.
So, there is an email address associated with every choice in the drop down. When the submit button of the form is clicked, the data of the form should be emailed to that corresponding email got from the selection made in the dropdown.
Could anyone suggest me how to do this?
Thanks!
 
You could do a check at the beginning of the script that ensures that no email generated unless the recipient address is matched against an array of allowable values.


Kind Regards
Duncan
 
You could use a drop down for names, and use the name to look up a hash

Code:
$mail{'bill'}="bill\@domain.com";
$mail{'phil'}="phil\@domain.com";
$mail{'dill'}="dill\@domain.com";
$mail{'lill'}="lill\@rugrats.com";
$name=param('name');
if ($name eq "") {
  $mailaddress="default\@domain.com";
} else {
  $mailaddress=$mail{$name};
}

HTH
--Paul


cigless ...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top