hmmm, ok, I moved the Content-Type line up in the program, and that got rid of 
the error.  Now, however, it dumps the raw text of the email - 

220 stanislaw.blah.blah.edu ESMTP Sendmail 8.12.2/8.12.2/SuSE Linux 0.6; Thu, 
25 Jul 2002 14:38:05 -0500 EHLO stanislaw 250-stanislaw.blah.blah.edu Hello 
localhost [127.0.0.1], pleased to meet you 250-ENHANCEDSTATUSCODES 
250-PIPELINING 250-8BITMIME 250-SIZE 250-DSN 250-ETRN 250-DELIVERBY 250 HELP 
MAIL FROM: 250 2.1.0 ... Sender ok RCPT TO: 250 2.1.5 ... Recipient ok DATA 
354 E... 

- to a the browser window.  This, of course, isnt desired.  What's going on?  
I guess I dont really understand what this Content-Type line is doing.  If I 
take it out all together, my error comes back.  I thought it was just a line 
to tell whatever viewing program recieves the text how to process it.  Is 
there a webpage with a good explanation of what's going on?

Also, i should say that after i send the email i want to create a confirmation 
page that will be sent to the browser.    



On Thursday 25 July 2002 14:12, [EMAIL PROTECTED] wrote:
> Webster,
>     Looks like your content-type is not being printed soon enough.  You
> should consider placing it at the very top of your script unless you expect
> print some other kind of header (like a Location). print "Content-Type:
> text/html\n\n";
>
> Regards,
> David
>
>
> ----- Original Message -----
> From: "webster" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Thursday, July 25, 2002 1:10 PM
> Subject: malformed header from script???
>
>
> I'm getting this error:
>
> malformed header from script.  Bad header=EHLO stanislaw
>
> if I turn off use strict, I get the error
>
> Premature end of script headers
>
>
> my code is posted below, and it runs all the way through because it sends
> the email - and the email has
>
> The error codes dont have line numbers with them, so Im not sure where to
> look.   Any help??
>
> here is my code. Its purpose is to take information from a form and email
> it to someone...try not to laugh at it
> ______________________________________________________________
>
> #!/usr/bin/perl -w
> use strict;
> use CGI;
> use XML::Twig;
> use Date::Calc qw( System_Clock );
> use SendMail;
>
>
>
> #---path stuff - you need to set these to values appropriate to your system
> my $pathToAssignNum = "/usr/local/httpd/htdocs/summer/xml/assignNum.txt";
> my $pathToReport_xml = "/usr/local/httpd/htdocs/summer/xml/report.xml";
> my $genWorkReport_URL =
> "http://somehostname.edu/cgi-bin/genWorkReport.cgi";;
>
>
>
> my $query = new CGI;
>
> #---setup SendMail
> my $sm = new SendMail();
> $sm->setDebug($sm->ON);
> $sm->To( "Jeremy Webster <jwebster\@olemiss.edu>" );
> $sm->Subject("Work Order");
>
> my $email = $query->param('email');
> $sm->From($email);
> $sm->ReplyTo($email);
>
>
> my $assignName  = $query->param('assName'); #pull in some values from the
> a/v form
> my $description = $query->param('description');
> #convert newline chars to <br> so it displays nice on webpage
> my $eol = chr(13).chr(10);  #CR/LF
> if($description =~ m/$eol/){
> $description=~s/$eol/<br \/>/g;
> }
>
> my $commissioner = $query->param('commissioners');
> if ($commissioner eq "Other") {$commissioner =
> $query->param('otherComish');} my $acctExec = $query->param('AcctExec');
>
> my $ddlMonth = $query->param('ddlMonth');
> my $ddlDay = $query->param('ddlDay');
> my $ddlYear = $query->param('ddlYear');
> my $ddlDeadline = $ddlMonth." ".$ddlDay.", ".$ddlYear;
>
> my $aeMonth = $query->param('aeMonth');
> my $aeDay = $query->param('aeDay');
> my $aeYear = $query->param('aeYear');
> my $aeDeadline  = $aeMonth." ".$aeDay.", ".$aeYear;
>
> my $ihMonth = $query->param('ihMonth');
> my $ihDay = $query->param('ihDay');
> my $ihYear = $query->param('ihYear');
> my $ihDeadline  = $ihMonth." ".$ihDay.", ".$ihYear;
>
> my $dimensions  = $query->param('dim');
> my $pageCount = $query->param('PageCount');
> my $quantity = $query->param('Quantity');
> my $sides = $query->param('sides');
> my $colorSpecs = $query->param('colorSpec');
> my $dicut = $query->param('Dicut');
> my $binding = $query->param('BindingSelect');
> my $art = $query->param('artSelect');
> my $laminate = $query->param('LaminSelect');
>
> my $paper = $query->param('Paper');
> my $otherPaper = $query->param('otherPaper');
> if($paper eq "Other") {$paper = $otherPaper;}
>
> my $envelopes = $query->param('Envelopes');
>
> my $special = "";
> $special = $query->param('special');
> if($special =~ m/$eol/){
> $special=~s/$eol/<br \/>/g;
> }
>
> my $artist = $query->param('artFrom');
> my $newGuy = $query->param('otherName');
>
> my @people = $query->param('per');
> my $seeList ="";
> my $person ="";;
> foreach $person(@people){
> if($person eq "otherPer"){
> $seeList .= $newGuy;
> }else{
> $seeList .= $person.", ";
> }
> }
>
>
> my ($year,$month, $day, $hour, $min, $sec, $doy, $dst);
> ($year, $month, $day, $hour, $min, $sec, $doy, $dst) = System_Clock();
> my $date = $month."/".$day."/".$year;
> my $time = $hour.":".$min.":".$sec;
>
>
>
> #check to make sure fields are filled in properly
> unless($email){
> print $query->header;
> print "Please fill in the Email field and try again";
> die "No email entered";
> }
>
> unless($assignName){
> print $query->header;
> print "Please fill in the Assignment Name field and try again";
> die "No name entered";
> }
>
> unless($description){
> print $query->header;
> print "Please fill in the description field and try again";
> die "No description entered";
> }
>
> unless($acctExec){
> print $query->header;
> print "Please fill in a value for the Account Executive and try again";
> die "No account executive entered";
> }
>
> unless($dimensions){
> print $query->header;
> print "Please fill in values for the dimensions of the project and try
> again";
> die "No dimensions entered";
> }
>
> unless($dicut){
> print $query->header;
> print "you forgot to choose a value for Dicut.  Please return to form and
> choose yes or no";
> die "No dicut entered";
> }
>
> unless($pageCount){
> print $query->header;
> print "you forgot to specify the Page Count. Please return to form and try
> again";
> die "No page Count entered";
> }
>
> unless($quantity){
> print $query->header;
> print "you forgot to specify the quantity.  Please return to form try
> again"; die "No quantity entered";
> }
>
> unless($sides){
> print $query->header;
> print "you forgot to specify the number of sides.  Please return to form
> try again";
> die "No quantity entered";
> }
>
> unless($paper){
> print $query->header;
> print "you forgot to specify the type of paper.  Please return to form try
> again";
> die "No quantity entered";
> }
>
> unless($envelopes) { $envelopes=""; }
>
> unless($artist){
> print $query->header;
> print "you forgot to specify the artist.  Please return to form try again";
> die "No quantity entered";
> }
>
> #read current assignment number
> open(assignFile, "<".$pathToAssignNum) or die("couldnt open
> assignNum.txt"); flock(assignFile, 2);
> seek( assignFile, 0, 0);
> my $number;
> while(<assignFile>){
> chomp;
> $number = $_;
> }
> close(assignFile);
> $number++;
>
> my $assNumber = substr($year,2,2)."-".$number;
>
> #write new assignment number
> open(assignFile, ">".$pathToAssignNum) or die ("couldnt open
> assignNum.txt"); flock(assignFile, 2);
> print assignFile $number;
> close(assignFile);
>
> open(File, "<".$pathToReport_xml) or die("couldnt open report.xml");
> flock(File, 2);
> seek(File, 0,0);
> my @text = <File>;
> close(File);
>
> open(oFile, ">".$pathToReport_xml);
> flock(oFile, 2);
> my $line;
> foreach $line (@text){
> chomp($line);
> if( $line eq "</report>" ){
> print oFile "\t<order>\n";
> print oFile "\t\t<orderDate>".$date."</orderDate>\n";
> print oFile "\t\t<assignNum>".$assNumber."</assignNum>\n";
> print oFile "\t\t<assignName>".$assignName."</assignName>\n";
> print oFile "\t\t<comish>".$commissioner."</comish>\n";
> print oFile "\t\t<acctExec>".$acctExec."</acctExec>\n";
> print oFile "\t\t<aeDeadline>".$aeDeadline."</aeDeadline>\n";
> print oFile "\t\t<status>D</status>\n";
> print oFile "\t\t<compDate>-</compDate>\n";
> print oFile "\t</order>\n";
> }
> print oFile "$line\n";
> }
> close(oFile);
>
> #start assembling messages
> #date is first
>
> $date = "Date: ".$date."\n";
> $time = "Time: ".$time."\n";
>
>
> #here is where I use the SendMail module and send it the prepared strings
> #**************************************************************************
>*
>
> my($mailbody) = <<EndOfMess;
> Content-type: text/html
>
>
> The following work has been requested.
>
> Thanks.
>
>
> Requestor's Email: $email
>
> $date
> $time
> Assignment name: $assignName
> Assignment #: $assNumber
> Description:
> $description
> Commissioner: $commissioner
> Account Executive: $acctExec
> _____________________________________________________________
> Deadlines
> Delivery to Location: $ddlDeadline
> Delivery to Account Exec: $aeDeadline
> In House Delivery: $ihDeadline
> ______________________________________________________________
> Description
> Dimensions: $dimensions
> Page Count: $pageCount
> Quantity: $quantity
> Sides: $sides
> Color Specification: $colorSpecs
> Dicut: $dicut
> Binding: $binding
> Photography/Artwork: $art
> Lamination: $laminate
> Paper: $paper
> Envelopes: $envelopes
> Special Instructions:
> $special
> ______________________________________________________________
> Personel
> Artist: $artist
> Needs to see: $seeList
>
> Thanks
>
> EndOfMess
>
> $sm->setMailBody($mailbody);
> if ($sm->sendMail() != 0){
> printError($sm->{'error'});
> die "screwy";
> }


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to