Friday, 30 April 2010 - 5:12 PM EDT
Name:
"cew"
Hi! I am having a similar problem.
As far as I know you need to have a mail template
(I think the extension for the template is .txt -- this is one of my questions though)
See
https://www.angelfire.lycos.com/build/cgi/index3.tmpl
Here is a sample template for the mail:
Mail Template
To: $form_mailto
From: cewcathar@hotmail.com
Subject: Visitor Feedback
$form_name, $form_email, $form_comments
(I saved my template in my cgi-bin and named my template
contact_mail.txt You then have to indicate the url of the mail template
with the expression $mail_template="./";
where the url is specified in between the slash and the closing quotation mark;
however I am not sure I have properly grabbed my variables from my form;
I used a program to read in my data to a buffer and then convert it to a
hash array -- it has to be a hash array so you can access the variables by name)
require AngelfireMail;
$MAIL = new AngelfireMail;
$mail_template = "./contact_mail.txt";
%variables = ('form_mailto' => $mail_to,
'form_name' => $name,
'form_email' => $email,
'form_comments' => $comments);
$MAIL->sendMail($mail_template, \%variables);
(Below is my read into buffer code; it may also have an error!
I got it at
http://www.yourhtmlsource.com/cgi/)
if ($ENV{'REQUEST_METHOD'} eq 'POST') {
# Reads in buffer
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
# Splits up the buffer into an array
# consisting of names
# and values for each name
@pairs = split(/&/, $buffer);
# defines the variables
# that it will write
foreach $pair (@pairs) {
($name, $value) = split(/=/, $pair);
$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$FORM{$name} = $value;
}
Hope someone can figure out what file is needed.
Best,
cew