I'm still learning myself and haven't tried sending email's from perl scripts (yet).  
I did however notice one typo which might help you grab more info on what's going on.

Check the below in your code.  Change 'use warnigs' to 'use warnings'

Hopefully it will help give you a bit more to go on. 

> #!/usr/bin/perl
> use warnigs;
> use strict;
> use MIME::Lite;
> use CGI 'param';
> I tried using this code but it's giving error.
> Can you explain in details pls as this is my first perl script & don't know 
> much of programming.
> 
> Thanks
> Nilanjana
> ---------------
> 
> 
> > On Wed, 4 Feb 2004 14:07:43 +0530, [EMAIL PROTECTED] (Nilanjana
> > Bhattacharya) wrote:
> > 
> > >Hello everybody,
> > >
> > >I have two radio buttons in a form. I want - When any one clicks on
> button "A" 
> > >a mail will be sent to "A" & when any one clicks on button "B" mail will
> be 
> > >sent to button "B". In both the cases whether someone clicks on A or B I
> will 
> > >receive a mail. Can anyone help me with the coding pls? 
> > 
> > Well here is some untested code which will give you a start.
> > 
> > #!/usr/bin/perl
> > use warnigs;
> > use strict;
> > use MIME::Lite;
> > use CGI 'param';
> > 
> > # Assign variables to arguments
> > # you need your html form to send these
> > my $a =  param{'button_a_address'} || undef;
> > my $b = param{'button_b_address'} || undef;
> > 
> > my $me = '[EMAIL PROTECTED]';
> > my $addr;
> > 
> > if(defined $a){$addr = $a}else{$addr = $b}
> >     
> > my $msg = MIME::Lite->new(
> > >From     =>'[EMAIL PROTECTED]',
> > To       =>$addr,
> > Bcc      =>$me,
> > Subject  =>'test message',
> > Type     =>'TEXT',
> > Data     =>'This is a test',
> > );
> > $msg->attach(Type     =>'application/octet-stream',
> > Encoding =>'base64',
> > Path     =>'test.zip',
> > );
> > $msg->send;
> > 
> > # Print HTML Out
> > print "Content-type: text/html\n\n";
> > print <<"END";
> > <html>
> > <head>
> > <title>Mail Sent!!</title>
> > </head>
> > <br>
> > <center>
> > <br><br>The file has been successfully sent to
> > print $addr;
> > </center>
> > </body>
> > </html>
> > **END**
> > __END__

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to