Lunarpages Web Hosting Forum

Author Topic: "Mail::Sendmail" not installed?  (Read 6823 times)

Offline stapel

  • Galactic Royalty
  • *****
  • Posts: 491
"Mail::Sendmail" not installed?
« on: January 13, 2004, 12:26:03 PM »
I'm trying to set up MailaForm, a form handler that e-mails results. (If I can get it to work, it will be a valid "reply" to my recent posting to this forum.) However, I'm getting the "Premature end of headers" message.

I followed the instructions given in a related post, and added lines to the beginning of the script for error reporting:
Code: [Select]
#!/usr/bin/perl -wT
use CGI;
use CGI::Carp qw(warningsToBrowser fatalsToBrowser);

$path = '/home/braden2/public_html';

use Mail::Sendmail;

print "Content-Type: text/html\n\n";
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
blah, blah, blah, and so forth

Now I get the following error:
Code: [Select]
Can't locate Mail/Sendmail.pm in @INC (@INC contains: /usr/lib/perl5/5.8.1/i686-linux /usr/lib/perl5/5.8.1 /usr/lib/perl5/site_perl/5.8.1/i686-linux /usr/lib/perl5/site_perl/5.8.1 /usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl) at mailform.pl line 7.
BEGIN failed--compilation aborted at mailform.pl line 7.

Does this mean that "mail::sendmail" isn't going to work?

Thank you.

Eliz.

P.S. I'm really clueless about this stuff, so please don't be shy about assuming that I'm a moron and need things spelled out in crayon.

Offline Ed

  • Berserker Poster
  • *****
  • Posts: 5156
    • Joke A Whenever
"Mail::Sendmail" not installed?
« Reply #1 on: January 13, 2004, 07:01:17 PM »
Can't seem to find my e-crayons :-) sorry....


If that whole part you pasted was given to you by someone else to paste in the header, then try just simply removing the use Mail::Sendmail; line, the script will handle it itself later on.

Usually you just specify the path to sendmail instead of using that command.

- Ed

Offline stapel

  • Galactic Royalty
  • *****
  • Posts: 491
"Mail::Sendmail" not installed?
« Reply #2 on: January 13, 2004, 07:08:29 PM »
According to what I've been able to find, "Mail::Sendmail" is actually not the same as "Sendmail". This is acknowledged to be confusing and misleading, but it's too late to change things now.

Eliz.


leighsww

  • Guest
"Mail::Sendmail" not installed?
« Reply #4 on: January 13, 2004, 07:57:31 PM »
Your error is saying that the "Mail:Sendmail" module is not located/installed on the server.  Hmmm.  Try replacing that with:

Net::SMTP

and see if it works.

Offline stapel

  • Galactic Royalty
  • *****
  • Posts: 491
"Mail::Sendmail" not installed?
« Reply #5 on: January 13, 2004, 08:18:10 PM »
Hmm... Yes, sort of....

After commenting out that line, the script managed to get as far as throwing up the error page (the designated HTML error page), but I can't tell what the error is. I'm still getting the "Premature end of headers" message in the error logs, but it's now in reference to the header GIF image on the page, not the Perl script. I was also getting an error message saying that something didn't have "execute" permissions to use the image. I set the image and the image folder to 777, and still go the same error, so I just changed the location of the image, and that message went away. But I'm still getting the "Premature end of headers" message... or not. I'm not sure. The error log isn't terribly consistent.

Would this be more or less annoying if I knew what I was doing?

Eliz.

Offline stapel

  • Galactic Royalty
  • *****
  • Posts: 491
"Mail::Sendmail" not installed?
« Reply #6 on: January 13, 2004, 08:20:59 PM »
leighsww: No change.

Eliz.

Offline Ed

  • Berserker Poster
  • *****
  • Posts: 5156
    • Joke A Whenever
"Mail::Sendmail" not installed?
« Reply #7 on: January 13, 2004, 09:06:53 PM »
more annoyying if you "knew" :-)

Thats the big issue with perl - absolutely aweful web client side debugging ability.

You might want to try 755 for permissions - the server sometimes prefers it.

What does it say on the error page you receive from the program?

Offline stapel

  • Galactic Royalty
  • *****
  • Posts: 491
"Mail::Sendmail" not installed?
« Reply #8 on: January 13, 2004, 09:17:14 PM »
Okay, the cPanel error log isn't showing anything new, so I'm not throwing any new spanners into the server's cogs. That's something, I guess.

When I'd commented out the "Mail::Sendmail" line, the script would send me to the HTML "sorry" page, which contains no actual error processing.

When I'd replaced the "Mail::Sendmail" line with the "Net::SMTP" line, the script failed and said that there was an error at line 138, which I found was where the script needs that mail::sendmail thing. That part of the script looks like this:
Code: [Select]
 $mail{To} = $mailto;              #get hash %mail ready for mail::sendmail
  $mail{From} = $input{email};
  $mail{Subject} = $subject;
  $mail{Cc} = $config{ccemail} if $config{ccemail};
  $mail{'X-Mailer'} = "Mail::Sendmail";
  $mail{message} = $mailmessage;
  sendmail %mail;                              #THIS IS LINE 138
  for $regel (@danku) {
   print $regel if ($regel !~ /^\#/);

   }
  }

There are later calls for "sendmail %mail", but probably if we can fix this bit then the other bits can be fixed in like manner.

Thank you.

Eliz.

P.S. I'm putting my crayons away now and heading to bed. Talk to you later.