Easy there fellah, don't blow a gasket. I'm not arrogant with my perl knowledge, I use Perl monks for help a lot more than I use it to provide answers.
However, having said that, your original post looked a lot like a high schooler looking for an easy answer for a programming assignment. If such is not the case, then it's all well and good.
You want to use the CGI module to take the input from your html form. First step would be to point your html form to your perl script.. something like:
<FORM METHOD="POST" ACTION="/cgi-bin/button.cgi">
Then in your perl script you need to create a new cgi object, like so:
use strict;
use Mail::Sendmail;
use CGI;
my $cgi = new CGI;
Then get the value of the button that was checked.
my $button_value = $cgi->param('m_EmailGroups');
Then you'll need to do whatever comparison you need to do on the $button_value variable, and then send the email:
my %mail = (
To => 'myhomeaddress@isp.com',
From => 'myworkaddress@company.com',
Subject => 'Form Submission',
Message => "The $button_value button was checked."
);
sendmail(%mail) or die $Mail::Sendmail::error;
All code is untested and offered as a guide. Take it, read it, learn it, change it, use it. |