in reply to Re: Re: Re: Premature end of script headers
in thread Premature end of script headers

I followed your instructions but the only thing I am having trouble with is the sendmail code. What are your suggestions? Thanks for all your help This is what I have so far
#!/usr/bin/perl -w use CGI; use CGI::Carp qw(fatalsToBrowser); CGI::ReadParse(); print MAIL "$in{'Title'}\n"; print MAIL "$in{'Name'}\n"; print MAIL "$in{'Position'}\n"; print MAIL "$in{'School'}\n"; print MAIL "$in{'Address'}\n"; print MAIL "$in{'Suburb'}\n"; print MAIL "$in{'State'}\n"; print MAIL "$in{'PCode'}\n"; print MAIL "$in{'Email'}\n"; print MAIL "$in{'Phone}\n"; print MAIL "$in{'Fax'}\n"; print MAIL "$in{'PR02'}\n\n"; print MAIL "$in{'PR03'}\n"; print MAIL "$in{'PR04'}\n"; print MAIL "$in{'Att1'}\n"; print MAIL "$in{'Att2'}\n"; print MAIL "$in{'Att3'}\n"; print MAIL "$in{'Att4'}\n"; print MAIL "$in{'Att5'}\n"; print MAIL "$in{'Att6'}\n"; print MAIL "$in{'Att7}\n"; print MAIL "$in{'Att8'}\n"; print MAIL "$in{'Att9'}\n"; print MAIL "$in{'Comments'}\n"; $recipients = "dawson.nicholas.a\@edumail.vic.gov.au"; $mailprog = '/usr/sbin/sendmail'; open(MAIL,"|$mailprog -t"); print MAIL "To: $recipients \n"; print MAIL "From: $Email \n"; print MAIL "Subject: Travancore School Professional Development \n\n" +; print MAIL "Travancore School Professional Development\n\n"; print MAIL "Hi, I have just visited your website.\n\n"; print MAIL "Personal Details\n";

Replies are listed 'Best First'.
Re: Re: Re: Re: Re: Premature end of script headers
by Cody Pendant (Prior) on Aug 08, 2003 at 04:14 UTC
    Well if that's what you're using then you've just got the code in the wrong order.

    You can't print to MAIL before it's opened.

    Do the open() thing first, then all the prints.



    ($_='kkvvttuubbooppuuiiffssqqffssmmiibbddllffss') =~y~b-v~a-z~s; print