Re: Perl/sendmail question

by Eric Frazier <ef(at)kwinternet.com>

 Date:  Tue, 29 Jan 2002 19:05:33 -0500
 To:  FODAC(at)aol.com
 Cc:  <hwg-techniques(at)mail.hwg.org>
  todo: View Thread, Original
Hi,

single quote means that perl will not try to use variable interpolation. So
nothing has to be escaped. Better to look at your error log.
Or try steping though the program with perl -d and keep hitting n to step
line by line. 
You can stop at any point and type print varname to get the value of
something at that point. 

Oh and the || should be an or. on the line 
open (MAIL, "| /usr/sbin/sendmail/ -t -i") || die ("cannot open");

Oh and also that EOM block will be taken literaly and carrage returns and
newlines mean a great deal. Two blank lines can be taken to mean \n\n
which can mean end of message.  That definatly should not be the first thing
you pass to sendmail. 



Eric 

At 04:58 PM 1/29/02 EST, FODAC(at)aol.com wrote:
>I am trying to run the following script (I wanted to prove I could do this
myself). The HTML appears just fine without any errors but the message is
never sent. Is this a Perl problem or a sendmail problem?
>
>TIA,
>
>Kevin Riggs
>fodac.org
>
>#!/usr/bin/perl -wT
>
>use strict;
>use CGI;
>
>my $handler;
>my $sendmail;
>
>my $name;
>my $address;
>my $city;
>my $state;
>my $zip;
>my $code;
>my $p1;
>my $p2;
>my $email;
>
>$handler = CGI::new();
>
># $sendmail = "/usr/sbin/sendmail/ -t -i";
>
>$name = $handler->param("name");
>
>$email = 'fodac(at)aol.com';
>
>print $handler->header();
>print $handler->start_html(
>        -title=>"Form data\n",
>        -bgcolor=>"#ff1234");
>
>print ("Thank you for e-mailing us");
>print $handler->end_html();
>
>open (MAIL, "| /usr/sbin/sendmail/ -t -i") || die ("cannot open");
>print MAIL <<EOM;
>
>
>To: Kevin Riggs <$email>;
>From: $name;
>
>EOM
>
>
>close MAIL;
>

http://www.kwinternet.com/eric
(250) 655 - 9513 (PST Time Zone)

HWG hwg-techniques mailing list archives, maintained by Webmasters @ IWA