Nickd_69,
Ok - you have forgetten to use Mail::Mailer which might just be a typo on your part. I would suggest reading the docs - it can use Sendmail if you want by replacing 'smtp' with 'sendmail'.

Additionally - you are printing to the MAIL filehandle, but haven't opened it anywhere. You don't want to do that. Move the my $mailer = stuff before any of the print statements and then change all the MAIL lines to $mailer.

You also didn't create the CGI object used to redirect the page later.

You really want to look into hash slices. It could make your life a lot easier. The problem is that unless you have done form validation using JavaScript - you might be attempting to print an uninitalized variable. See my update to your code below:

#!/usr/bin/perl -wT use CGI; use CGI::Carp qw(fatalsToBrowser); use Mail::Mailer; CGI::ReadParse(); my $query = CGI->new(); my $mailer = new Mail::Mailer ( "smtp" ); $mailer->open( { To => 'dawson.nicholas.a@edumail.vic.gov.au', From => $in{'Email'}, Subject => 'Travancore School Professional Development' } ); print $mailer "$in{'Title'}\n"; print $mailer "$in{'Name'}\n"; print $mailer "$in{'Position'}\n"; $mailer->close; print $query->redirect('http://www.travancoresch.vic.edu.au/developmen +t/reply02.html');
That should move you along I think, still don't have a web server to test it on though. What were the errors you got with my code anyway?

Cheers - L~R


In reply to Re: Re: Re: Re: Re: Premature end of script headers by Limbic~Region
in thread Premature end of script headers by Nickd_69

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.