Gossamer Forum
Home : Products : Links 2.0 : Installation -- Unix :

basic stuff re mailer

Quote Reply
basic stuff re mailer
I have the expirator installed on my site however when I try to send an expiry notice I receive a message indicating an error in the following area. I know the answer is likely easy and very basic but my knowledge base in this area is limited. Can someone help? Please?

sub send_email {
# --------------------------------------------------------
# All the link information is stored in %link.
my (%link) = @_;

# Set the to, from, subject and message to send.
my $to = $link{'Contact Email'};
my $from = $db_admin_email;
my $subject = "$your_link_is_expired";
my $msg = &load_template ('email-exp.txt', \%link);

# Then mail it away!
require "$db_data_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
&cgierr("Unable to init mailer! Reason: $Mailer::error");
$mailer->send or &cgierr ("Unable to send modification message. Reason: $Mailer::error");
}


Quote Reply
Re: basic stuff re mailer In reply to
The error could be the following:

Code:

my $subject = "$your_link_is_expired";


The "variable" $your_link_is_expired does not seem to be defined anywhere. Either DEFINE that variable OR simply use something like the following:

Code:

my $subject = "Your Link is Expired";


Regards,

Eliot Lee
Quote Reply
Re: basic stuff re mailer In reply to
Thanks Eliot for the quick response. I should expand on this, the error message I get reads as follows:
CGI ERROR
==========================================
Error Message : fatal error: Can't locate /Mailer.pm in @INC (@INC contains: /usr/local/etc/httpd/htdocs/irealtor/cgi-bin/links/admin /usr/local/lib/perl5/5.00503/i386-freebsd /usr/local/lib/perl5/5.00503 /usr/local/lib/site_perl /usr/local/lib/site_perl .) at /usr/local/etc/httpd/htdocs/irealtor/cgi-bin/links/admin/nph-expirator.cgi line 344.

Script Location : /usr/local/etc/httpd/htdocs/irealtor/cgi-bin/links/admin/nph-expirator.cgi
Perl Version : 5.00503
***********************************************************
line # 344 is this: require "$db_data_path/Mailer.pm";
***********************************************************
I am afraid I don't quite know what to do, your advice would be most appreciated as my knowlegde in this area is basic. Thanks!

Quote Reply
Re: basic stuff re mailer In reply to
In Reply To:
ine # 344 is this: require "$db_data_path/Mailer.pm";
Right...because no where in the script have you referenced or defined $db_data_path.

You should include the following codes at the top of the script:

Code:

require "/absolute/path/to/cgi-bin/links/admin/links.cfg";


Change all the folder/directory info ("/absolute/path/to/cgi-bin/admin/") to your ABSOLUTE, NOT RELATIVE path where the links.cfg file is located. BY requiring the links.cfg file, you will have the $db_data_path defined IF you have the $db_data_path defined in your links.cfg file.

Regards,

Eliot Lee