Quote:
|
Originally Posted by Iturea Yeah lets see your mail script. |
Okay then, here goes...
This is the Tripod Mail.pm [ Just the Header of the Original Module Script... ]
************************************************** ***********************************
package TripodMail;
################
# TripodMail.pm #
################################################## ###########################
# TripodMail is a module that allows you to send out email messages with
# your scripts. In order to use it you'll have to have a mail template in
# your cgi-bin directory. The mail template will need to look something
# like this:
# To: $email
# From:
FredFlintstone@hotmail.com
# Subject: YabbaDabbaDoo!
#
# Hello $name,
# Congratulations! You're user number $number of this mail script!
# You can add other email headers (Reply-To:, Errors-To:, etc), but To:
# and From: are manditory. You can customize your email by adding variables
# wherever you would like to fill something in on the fly.
# The sendMail method requires 2 parameters- the location of the mail
# template file, and a reference to a hash of variables.
# The keys of the varaible hash should correlate with the variables in the
# mail template.
# Example of use:
# require TripodMail;
# $MAIL = new TripodMail;
# $mail_template = "./flintstones_mail.txt";
# %variables = ('email' => 'Wilma@gurlmail.com',
# 'name' => 'Wilma',
# 'number' => '2');
# $MAIL->sendMail($mail_template, \%variables);
# Note: In order to prevent spamming, you will be limited to sending out 240
# mails per day.
################################################## #########################
************************************************** ***********************************
And Here is How did I try to Apply it to my Perl Script:-
************************************************** ***********************************
================================================== ==============================================
gBook.pl // Perl Script used to Send the Email
================================================== ==============================================
my $CGI = new TripodCGI;
my $number = $CGI->param('number');
my $name = $CGI->param('name');
open(LIST, ">>gBook_list.txt"); // Log Entries
print LIST <<END;
$name\r
END
close(LIST);
print <<END;
Content-Type: text/html\n\n
require Mail; // This is Okay even Not Using TripodMail
$mail = new Mail; // This is Okay even Not Using new TripodMail
$mail_template = "gBook.txt";
%templateVar = ('webmaster' => '// My E-mail Address is Here',
'name' => "$name",
'number' => "$number");
$mail->sendMail($mail_template, \%templateVar);
print <<END;
Content-Type: text/html\n\n
// This Space is an HTML Page added for Users to be shown after Submitting - Not Shown Here
END
================================================== ==============================================
gBook.txt // Mail Template used for the Email
================================================== ==============================================
To: $webmaster
From: My Web Site is Here
Subject: New Member on List - This is the Topic
$name
$number
************************************************** ***********************************
So, do you think I Missed something?... or made some Mistakes?...
I bet you can't answer...
But I hope you can answer... ;-)
Thanks in Advance!