in reply to Re: Re: sending email based on form checkbox selection
in thread sending email based on form checkbox selection
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:
Then get the value of the button that was checked.use strict; use Mail::Sendmail; use CGI; my $cgi = new CGI;
Then you'll need to do whatever comparison you need to do on the $button_value variable, and then send the email:my $button_value = $cgi->param('m_EmailGroups');
All code is untested and offered as a guide. Take it, read it, learn it, change it, use it.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;
|
|---|