Nickd_69,
Ok - I am likely going to receive some downvotes for being so harsh with you, but so be it. It doesn't appear that you are even beginning to make an effort here. In Premature end of script headers you asked this very question. I gave you advice here, and provided more advice as well as code here and here. You didn't take my advice nor did you come back to say what errors you ran into. So let me break it down step by step.
#!/usr/bin/perl -w # This turns on warnings use strict; # This pragma will help you avoid common mistakes by enforcing commonl +y accepted "good" coding techniques use CGI; # This will allow you to redirect your web page once you send the emai +l use CGI::Carp qw(fatalsToBrowser); # This will put any fatal errors to your web page instead of to the no +rmal error log use Mail::Mailer; # This will allow you to send the email my $query = CGI->new(); # This creates a new CGI object. The redirect method will come after +we have sent the mail. my %DATA = $query->Vars; # This uses a method on the CGI object to stick all the form values i +nto the DATA hash for you my $mailer = new Mail::Mailer ( "smtp" ); $mailer->open( { To => 'info@travancoresch.vic.edu.au', From => $DATA{Email}, Subject => 'Travancore School Professional Development' } ); # This will create a new object that we will use to send the email print $mailer "$DATA{Att1}\n"; print $mailer "$DATA{Att2}\n"; print $mailer "$DATA{Att3}\n"; # This will print to the email $mailer which is a file handle created +for you when you create the object. $mailer->close; # This sends the email print $query->redirect('http://www.travancoresch.vic.edu.au/developmen +t/reply02.html'); # This redirects the web page to the new desired location
I am going to suggest you read the past replies I have sent to actually look at the comments I made and not just blindly copy and paste code. You have repeated the same mistakes.

If you do all that and it still doesn't work - come back and tell us what errors you got - we will be glad to help.

L~R


In reply to Re: How do I send mail from a script? by Limbic~Region
in thread How do I send mail from a script? 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.