Followed all the instructions and everything looks fine. However, when I send a message to a friend it seems like it send with no error message but the recipient did not received the mail.
Here is a copy of teller.cgi.
#!/usr/bin/perl
# -------------
# Links
# -------------
# Links Manager
#
# File: teller.cgi
# Lets visitors recommend your site to a friend
# Author: Glenn Utteridge
# Based on and designed to be used with
#Links 2 by: Alex Krohn
# Email: alex@gossamer-threads.com
# Web: http://www.gossamer-threads.com/
# Version: 2.0
#
# (c) 1998 Gossamer Threads Inc.
#
# This script is not freeware! Please read the README for full details
# on registration and terms of use.
# =====================================================================
#
#
# Setup:
# Make sure the require statement below points to the config file.
# Required Librariers
eval {
($0 =~ m,(.*)/[^/]+,) && unshift (@INC, "$1"); # Get the script location: UNIX /
($0 =~ m,(.*)\\[^\\]+,) && unshift (@INC, "$1"); # Get the script location: Windows \
require "/home/sites/site136/web/cgi-bin/search/admin/links.cfg"; # Change this to full path to links.cfg if you have problems.
require "$db_lib_path/db_utils.pl";
require "$db_lib_path/links.def";
$build_use_templates ?
require "$db_lib_path/site_html_templates.pl" :
require "$db_lib_path/site_html.pl";
};
if ($@) {
print "Content-type: text/plain\n\n";
print "Error including libraries: $@\n";
print "Make sure they exist, permissions are set properly, and paths are set correctly.";
exit;
}
# ========================================================
eval { &main; }; # Trap any fatal errors so the program hopefully
if ($@) { &cgierr("fatal error: $@"); } # never produces that nasty 500 server error page.
exit; # There are only two exit calls in the script, here and in in &cgierr.
sub main {
# --------------------------------------------------------
# Sends an email to a friend recommending this site
my %in = &parse_form();
my $site_url = "http://test.com";
# Make sure the email address at least looks like an email address.
my $receiver = $in{'receiver'};
my $rname = $in{'rname'};
($receiver =~ /.+@.+\..+/) or &site_html_refer_error ("The email address: '$receiver' doesn't look like a real email address.") and return;
($rname =~ /[A-Za-z]+/) or &site_html_refer_error ("Please enter their name as well as their email address.") and return;
my $sender = $in{'sender'};
my $sname = $in{'sname'};
($sender =~ /.+@.+\..+/) or &site_html_refer_error ("The email address: '$sender' doesn't look like a real email address.") and return;
($sname =~ /[A-Za-z]+/) or &site_html_refer_error ("Please enter your names as well as your email address.") and return;
$site =
# Check to make sure that there is an admin email address defined.
$db_admin_email or &cgierr("Admin Email Address Not Defined in config file!");
my $to = $in{'receiver'};
my $from = $in{'sender'};
my $subject = "I've just seen a great site!";
my $msg = qq|
To $in{'rname'}
message = "I just found this page and I think its great. The url is http://test.com
check it out!"
Cheers
$in{'sname'}
|;
# Then mail it away!
require "$db_lib_path/Mailer.pm";
my $mailer = new Mailer ( { smtp => $db_smtp_server,
sendmail => $db_mail_path,
from => $from,
subject => $subject,
to => $to,
msg => $msg,
log => $db_mailer_log
} ) or return;
$mailer->send or return;
print &site_html_refer_mail;
}
Any input will be greatly appreciated!
Mack
Here is a copy of teller.cgi.
#!/usr/bin/perl
# -------------
# Links
# -------------
# Links Manager
#
# File: teller.cgi
# Lets visitors recommend your site to a friend
# Author: Glenn Utteridge
# Based on and designed to be used with
#Links 2 by: Alex Krohn
# Email: alex@gossamer-threads.com
# Web: http://www.gossamer-threads.com/
# Version: 2.0
#
# (c) 1998 Gossamer Threads Inc.
#
# This script is not freeware! Please read the README for full details
# on registration and terms of use.
# =====================================================================
#
#
# Setup:
# Make sure the require statement below points to the config file.
# Required Librariers
eval {
($0 =~ m,(.*)/[^/]+,) && unshift (@INC, "$1"); # Get the script location: UNIX /
($0 =~ m,(.*)\\[^\\]+,) && unshift (@INC, "$1"); # Get the script location: Windows \
require "/home/sites/site136/web/cgi-bin/search/admin/links.cfg"; # Change this to full path to links.cfg if you have problems.
require "$db_lib_path/db_utils.pl";
require "$db_lib_path/links.def";
$build_use_templates ?
require "$db_lib_path/site_html_templates.pl" :
require "$db_lib_path/site_html.pl";
};
if ($@) {
print "Content-type: text/plain\n\n";
print "Error including libraries: $@\n";
print "Make sure they exist, permissions are set properly, and paths are set correctly.";
exit;
}
# ========================================================
eval { &main; }; # Trap any fatal errors so the program hopefully
if ($@) { &cgierr("fatal error: $@"); } # never produces that nasty 500 server error page.
exit; # There are only two exit calls in the script, here and in in &cgierr.
sub main {
# --------------------------------------------------------
# Sends an email to a friend recommending this site
my %in = &parse_form();
my $site_url = "http://test.com";
# Make sure the email address at least looks like an email address.
my $receiver = $in{'receiver'};
my $rname = $in{'rname'};
($receiver =~ /.+@.+\..+/) or &site_html_refer_error ("The email address: '$receiver' doesn't look like a real email address.") and return;
($rname =~ /[A-Za-z]+/) or &site_html_refer_error ("Please enter their name as well as their email address.") and return;
my $sender = $in{'sender'};
my $sname = $in{'sname'};
($sender =~ /.+@.+\..+/) or &site_html_refer_error ("The email address: '$sender' doesn't look like a real email address.") and return;
($sname =~ /[A-Za-z]+/) or &site_html_refer_error ("Please enter your names as well as your email address.") and return;
$site =
# Check to make sure that there is an admin email address defined.
$db_admin_email or &cgierr("Admin Email Address Not Defined in config file!");
my $to = $in{'receiver'};
my $from = $in{'sender'};
my $subject = "I've just seen a great site!";
my $msg = qq|
To $in{'rname'}
message = "I just found this page and I think its great. The url is http://test.com
check it out!"
Cheers
$in{'sname'}
|;
# Then mail it away!
require "$db_lib_path/Mailer.pm";
my $mailer = new Mailer ( { smtp => $db_smtp_server,
sendmail => $db_mail_path,
from => $from,
subject => $subject,
to => $to,
msg => $msg,
log => $db_mailer_log
} ) or return;
$mailer->send or return;
print &site_html_refer_mail;
}
Any input will be greatly appreciated!
Mack