in reply to Re: sending email based on form checkbox selection
in thread sending email based on form checkbox selection

I have searched Google for almost a week and found most of the solution is already written as an application. I'm looking for something basic help here. I'm not a big time programmer like you are, this is new to me, I'm willing to admit that. But if you want to make a big deal out of this, so be it!! By the way, I'm not looking for anyone to do my work! If you are so arrogant to help someone new to Perl then that's your problem... Remember you were once in my shoes...
  • Comment on Re: Re: sending email based on form checkbox selection

Replies are listed 'Best First'.
Re: Re: Re: sending email based on form checkbox selection
by erasei (Pilgrim) on Jul 01, 2003 at 13:57 UTC
    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.