This is the section of the script that sends the email. You need to know where sendmail is located on your server in order to use it. Also, always make sure that you include a Reply-to line in your email message. Since this mail is sent by the Web server, it could mess up the headers if you don't include that line.
sub sendemail
{
open (SENDMAIL, "| /usr/bin/sendmail -t -n");
print SENDMAIL <<EOM
From: from\@abc.com
To: to\@abc.com
Reply-to: from\@abc.com
Subject: Email from the mail form
This is a message from your mail form. The form results are:
fullname = $in{'full_name'}
EOM
}
This prints a thank you page that thanks the reader for submitting the form. You can include any HTML elements that you would put on a normal HTML page, including JavaScript and other dynamic elements.
sub printthanks
{
print "Content-type: text/html \n\n";
print <<"EOM";
<html>
<head>
<title>Thanks for Submitting the Form</title>
</head>
<body bgcolor="#ffffff">
<h2>Thank you for answering our form</h2>
You should receive a response shortly.
</body>
</html>
EOM
print "";
}
This article is part of the HTML Forms Tutorial

