Gossamer Forum
Home : Products : DBMan : Discussions :

Mass Mail Mod error

Quote Reply
Mass Mail Mod error
I know this is a DBMan forum but since this is a MOD, I am hoping that someone will know the answer to this.

Firstly, the link to the internam Mass Mailer on GT is not working. (just an FYI).

I have finally gotten DBMan up and running with my revised fields, thanks to JP Deni's configurator. I have installed and modified this DB a couple of times before with no problems. However, on JP's site I downloaded the mass mailer and installed that mod. It works except for the html_mass_mail_success area. This is what I am getting.
~~~~~~~~~~
DBMan encountered an internal error.

CGI ERROR
==========================================
Error Message : fatal error: Undefined subroutine &main::html_mass_mail_success called at db.cgi line 181.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I have removed and reinserted that particular portion of the MOD without success. Anyone else ever got this??

LHaase

Quote Reply
Re: Mass Mail Mod error In reply to
Well, I found my old login here. Different name but the same person with the same problem.

To expand on this, here is my code.

Here is my subroutine...........
sub mass_mail {
# --------------------------------------------------------
#
my ($i,$message,@lines,$line,$count,%rec,$mail_count);

unless ($admin_email) { $message = "Admin email has not been entered in the .cfg file<BR>"; }
unless ($admin_email =~ /.+\@.+\..+/) { $message = "Admin email address is not in the correct format.<BR>"; }
unless ($in{'subject'}) { $message .= "You must fill in a subject for your message.<BR>"; }
unless ($in{'emailmessage'}) { $message .= "Your email message is empty.<BR>"; }
for ($i = 0; $i <= $#db_cols; $i++) {
if ($db_email_field eq $db_cols[$i]) {
$found = 1;
last;
}
}
if (!$found) {
$message .= "email field not found<BR>";
}
open (DB, "<$db_file_name") or &cgierr("error in mass_mail. unable to open database: $db_file_name.\nReason: $!");
@lines = <DB>;
close DB;
foreach $line (@lines) {
(/^#/) and next;
(/^\s*$/) and next;
++$count;
}
$in{'mh'} = $count;
my ($status, @hits) = &query("view");
unless ($status eq 'ok') {
$message .= "$status<BR>";
}
if ($message) {
chomp($message);
&html_mass_mail_form($message);
return;
}
my ($numhits) = ($#hits+1) / ($#db_cols+1);
for (0 .. $numhits - 1) {
%rec = &array_to_hash($_, @hits);
if ($rec{$db_email_field} =~ /.+\@.+\..+/) {
open (MAIL, "$mailprog") || &cgierr("unable to open mail program");
print MAIL "To: $rec{$db_email_field}\n";
print MAIL "From: $admin_email\n";
print MAIL "Subject: $in{'subject'}\n\n";
print MAIL "-" x 75 . "\n\n";
print MAIL $in{'emailmessage'};
close (MAIL);
++$mail_count;
}
}
&html_mass_mail_success($mail_count);
}
.............................................
It is this last line of code that the debugger says has a problem.

Any ideas???




Quote Reply
Post deleted by Karen In reply to
Quote Reply
Post deleted by Karen In reply to
Quote Reply
Post deleted by Karen In reply to
Quote Reply
Post deleted by Karen In reply to
Quote Reply
Post deleted by Karen In reply to
Quote Reply
Post deleted by Karen In reply to
Quote Reply
Re: Mass Mail Mod error In reply to
Perhaps there was an earlier correction that JPDeni had made via the forums ... your html.pl file does not have html_mass_mail_success but the mod instructions that I was able to locate this morning doesn't have it either Smile

Try changing the following line as indicated. Let us know if that works for you.


sub html_mass_mail_success {
#-----------------------------------------------

my ($message) = $_[0];




Quote Reply
Re: Mass Mail Mod error In reply to
That did it!!!! Thank you so much Karen for seeing that.