Loading ...
Sorry, an error occurred while loading the content.

Re: sendmail

Expand Messages
  • Damien Carbery
    Have you gotten it to work from the command line? c: perl bin perl.exe -w moses_rtn_info.pl Obviously enter test info for name and address. I, as Charles has
    Message 1 of 4 , Apr 26 6:42 PM
    View Source
    • 0 Attachment
      Have you gotten it to work from the command line?
      c:\perl\bin\perl.exe -w moses_rtn_info.pl
      Obviously enter test info for name and address.
      I, as Charles has mentioned, always recommend using the "strict"
      module. There is certainly no harm in it. You'll have to add 'my' in
      your variable declarations.

      Here a simplification idea:
      sub getName{
      return "Name :" . param('name');
      }

      --- In perl-beginner@y..., billbcpp@y... wrote:
      > I changed the script to include: $mail{smtp} = 'smtp.gateway.net';
      > before I called sendmail(). It still won't work,here are the exact
      > error messages:
      >
      > [Thu Apr 26 17:02:17 2001] [error] [client 127.0.0.1] Premature end
      > of script headers: c:/program files/apache group/apache/cgi-
      > bin/moses_rtn_info.pl
      >
      >
      >
      > --- In perl-beginner@y..., "Damien Carbery" <daymobrew@y...> wrote:
      > > Have you specified a valid SMTP server?
      > > Before you call sendmail() you can say:
      > > $mail{smtp} = 'my.smtp.server';
      > >
      > > If you have already done this, please post the exact error
      > > messages.
      > >
      > > --- In perl-beginner@y..., billbcpp@y... wrote:
      > > > Hi All,
      > > >
      > > > Ok I downloaded Mail::Sendmail v. 0.78 and installed it and it
      > > tested
      > > > fine. I am trying to test out a form locally on my system
      > (Windows
      > > > 98) using Apache 1.3.19 for the local server. I am trying to
      > combine
      > > > using CGI.pm to parse the material form the form as well. One
      > note,
      > > > the shebang line needs to be c:\perl\bin\perl.exe to run it
      > locally.
      > > > I keep getting "malformed header" and "bad file desriptor"
      error
      > > > messages. Any suggestions? Thanks.
      > > >
      > > > B
      > > >
      > > > #!c:\perl\bin\perl.exe -w
      > > > use CGI ':standard';
      > > > use Mail::Sendmail;
      > > >
      > > > %mail=( To => 'hsport@g...',
      > > > From =>'hsport@g...',
      > > > Message=>getName(),
      > > > Message=>getAddress(),
      > > > );
      > > > $mail{smtp} = 'smtp.gateway.net';
      > > >
      > > > sendmail(%mail) || die "can't send mail $!\n";
      > > >
      > > > sub getName{
      > > > $name=param('name');
      > > > $person="Name :";
      > > > $whole=$person . $name;
      > > > return $whole;
      > > > }
      > > > sub getAddress{
      > > > $address=param('address');
      > > > $head="Address :";
      > > > $where=$head . $address;
      > > > return $where;
      > > > }
    Your message has been successfully submitted and would be delivered to recipients shortly.