Hello pardeep

Good article, There are a number of ways to tell Perl scripts where to send email.

Here is the script. Below the code is a discussion of it's various elements.


#!/usr/bin/perl
$Mailer = '/sbin/sendmail -t';
$Email = $ENV{QUERY_STRING};
open MAIL,"|$Mailer";
print MAIL <<THE_EMAIL;
From: me\@mydomain.com
To: $Email
Subject: My first mailer


This is the auto-response email sent when I launched the
script with a "?$Email" following the script's URL.


Yeah!
THE_EMAIL
close MAIL;
print "Content-type: text/html\n\n";
print '<center>T H A N K Y O U !</center>';
# end of script



The first line of the script must have the location of Perl on your server.