Frowarding mail automatically through script

From: Vishwas Bhakit (vbhakit_at_yahoo.co.in)
Date: 11/27/04


Date: Sat, 27 Nov 2004 12:30:20 +0000 (GMT)
To: beginners@perl.org

i had written following script for sending mail automatically through
PERL using "sendmail" program in the perl script.
But its not workig. What may be the problem with it.
 
#!/usr/local/bin/perl
$name = 'name';
$email = 'mail id';
open(MAIL, "| /usr/lib/sendmail -oi -n -t");
print MAIL <<EMAIL_TO_USER;
To:$email
From:"somebody\@domain.com
Subject: More Information
Dear $name:
Thank you for contacting us. We will send you the material to this email address.
EMAIL_TO_USER
close MAIL;
print "Content-type:text/html\n\n";
print <<HTML_RESPONSE;
<html>
<title>Thank You Page</title>
<h1>Thanks!</h1>
Thanks, $name!<br>
I'll mail information to $address right away.
</html>

 
 

Yahoo! India Matrimony: Find your life partneronline.