#!/usr/bin/perl ##################################################### # Script by MP.Prakash R.Lewis # # http://www.bestnetcraft.com # # This script is offered in the same terms as Perl. # # Comments and suggestions may be sent through # # http://www.bestnetcraft.com/contact.html # # No liability or damage will be accepted by the # # author under any circumstances. # ##################################################### # Check out the Readme File # Sends email messages to friends of your website visitors # after the thanks message will take your visitor to this page - ipred # Configuration - User defined variables $MAIL_PROGRAM="/usr/bin/sendmail -t"; $diro="user"; $ipred="/resource.html"; read(STDIN,$temp,$ENV{'CONTENT_LENGTH'}); @pairs=split(/&/,$temp); foreach $item(@pairs) { ($key,$content)=split(/=/,$item,2); $content=~tr/+/ /; $content=~s/%(..)/pack("c",hex($1))/ge; $content =~ s///g; $fields{$key}=$content; $i++; $item{$i}=$key; $response{$i}=$content; } # check for validity &nyet('NAME') unless ($fields{'NAME'}); &nyet('EMAIL') unless ($fields{'EMAIL'} =~ /.+\@.+/); &nyet('Name of your Friend') unless ($fields{'TONAME'}); &nyet('Email_id of your friends') unless ($fields{'TOEMAIL'} =~ /.+\@.+/); &nyet('Message') unless ($fields{'MSG'}); &sendemail; &thanks; sub nyet { print "Content-type: text/html\n\n"; print < Error in Information endo print "Apparently you have not entered the information in full. Check the $_[0] field ! Use your browser's back button to try again!\n"; die "Something is wrong with the $_[0] field.\n"; } sub thanks { open (ML,">>$diro/tella.log"); flock ML, 2; print ML "$fields{'NAME'}\n"; print ML "$fields{'EMAIL'}\n"; print ML "$fields{'TONAME'}\n"; print ML "$fields{'TOEMAIL'}\n"; print ML "$ENV{'REMOTE_ADDR' }\n"; flock ML, 8; close(ML); # thank the user at his browser print "Content-type: text/html\n\n"; print < Thanks

Hi $fields{'NAME'},

Thanks !


Your message will be communicated to your friend Mr.\\Ms. $fields{'TONAME'} and we appreciate your interest!


Webmaster,
eof } # sendemail sub sendemail { $bodyo =$fields{'MSG'}; open (MAIL_RECIP, "|$MAIL_PROGRAM"); print MAIL_RECIP <$fields{'NAME'} 's Recommandation Dear $fields{'TONAME'},
I happened to visit a website which elaborates about the fine crafts of the Net. It has free CGI,Perl scripts and ebooks for downloading. Feel free to explore Bestnetcraft.

$bodyo


Regards,
$fields{'NAME'}
Finecrafts of the Net-
Bestnetcraft

"Building a website involves a complete mix of design,technology and ingenuity. Understanding how to put all the pieces together requires a serious passion for the web in all its facets."


Well-researched contents - sheathed in powerful words to the accompanyment of optimized graphics and layered in the right choice of technology to deliver your messages for the maximum reach!

Take the first step in the right direction! Click -Bestnetcraft- at the top.

eof close(MAIL_RECIP); }