in reply to Re^5: Mail::Mailer on NT
in thread Mail::Mailer on NT

cant resolve the following erroes Premature end of script headers: d:/cgi-bin/mailsender.pl Can't locate object method "open" via package "C:/Program Files/Apache Group/Perl/site/lib/Mail/Mailer/sendmail.pm" (perhaps you forgot to load "C:/Program Files/Apache Group/Perl/site/lib/Mail/Mailer/sendmail.pm"?) at d:\cgi-bin\MAILSE~1.PL line 93.

Replies are listed 'Best First'.
Re^7: Mail::Mailer on NT
by snookmz (Beadle) on Mar 08, 2005 at 19:49 UTC
    Sounds like you may not have installed the module properly. Activestate has an automated method of installing modules, check that out in their documentation.

    Also run your script from the command line first in some kind of test mode, rather than running through the browser and checking the logs. "Premature end of script headers" simply means the web server (apache probably) didn't recieve the correct http headers.

    P.S. My advice is to be patient, especially on perlmonks.org. You will only offend monks by trying to get a quick response. Patience is a virtue with coding IMO. :)
Re^7: Mail::Mailer on NT
by RazorbladeBidet (Friar) on Mar 08, 2005 at 18:33 UTC
    Can you post the code you are using, please?
    --------------
    It's sad that a family can be torn apart by such a such a simple thing as a pack of wild dogs
      #!c:/program files/apache group/perl/bin/perl.exe -w use CGI; use strict; use warnings; use Mail::Mailer; my $YourEmail = "mymail@mymail.co.uk"; # Script works only on your server(s) - ('URL1','URL2') my $referers = ('mySite','152.21.1.2535); # Location of mail program - check your doc or ask admin my $MailProgram = 'C:/Program Files/Apache Group/Perl/site/lib/Mail/Mailer/sendmail'; # Header line in the auto-reply message my $Header = "GOOBERS UNLIMITED"; # Brief tail message for body of e-mail autoreply my $TailMessage = "If your message requires a reply, we'll get back to you soon."; # Your signature lines the end of the autoreply e-mail my $Signature1 = "personal"; my $Signature2 = "www.YourSite.com"; my $query = new CGI; my $sirName = $query ->param("sirName");####COming from html form my $firstName = $query ->param("firstName");####COming from html form my $Email = $query ->param("email");####COming from html form my $Add1 = $query ->param("add1");####COming from html form my $Add2 = $query ->param("add2");####COming from html form my $City = $query ->param("city");####COming from html form my $County = $query ->param("county");####COming from html form my $Postcode = $query ->param("postcode");####COming from html form my $Message = $query ->param("Message");####COming from html form my %headers = ('To' => 'mymail@mymail@mymail.co.uk', 'From' => '$Email +'); my $body = "$Message"; my $mailer = new Mail::Mailer 'sendmail'; $mailer ->open(\%headers); print $mailer $body; exit; ##### End of Script ############################

      2005-03-08 Janitored by Arunbear - added code tags, as per Monastery guidelines

        1. my $YourEmail = "mymail@mymail.co.uk";

        This is going to fail with use strict. Change to single quotes.
        2. Referers is a scalar being assigned a list and the single quote on the second element isn't closed.
        3. $Message is uninitialized.

        I'm surprised you even got this to run... try changing those and see what happens. Good luck.

        The scary part is that it looks like the code I referred to in my abysmally-rated node Re: Email form.

        Apparently it has come back to haunt me. (and in one day - not bad turnaround time)
        --------------
        It's sad that a family can be torn apart by such a such a simple thing as a pack of wild dogs