Home : Products : DBMan : Customization :

Products: DBMan: Customization: Re: [uhrwerk] Internal Mass Mailer - send to all users from default.pass file: Edit Log

Here is the list of edits for this post
Re: [uhrwerk] Internal Mass Mailer - send to all users from default.pass file
If you're using the secure password lookup mod, you should be able to pull the email addresses from there. Use the full mass mailer mod, but substitute the code below for sub mass_mail. (This has not been tested, except that I know it compiles in perl without syntax errors.)

Code:

sub mass_mail {
# --------------------------------------------------------
#
my ($i,$message,@passwds,$pass,$count,$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>"; }
open (PASSWD, "<$auth_pw_file") || &cgierr("unable to open password file. Reason: $!\n");
@passwds = <PASSWD>;
close PASSWD;
$found = '';
foreach $pass (@passwds) {
chomp ($pass);
($userid, $pw, $view, $add, $del, $mod, $admin, $email) = split (/:/, $pass);
open (MAIL, "$mailprog") || &cgierr("unable to open mail program");
print MAIL "To: $email\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);
}


JPD
----------------------------------------------------
JPDeni's DBMan-ual
How to ask questions the smart way.

Last edited by:

JPDeni: Mar 15, 2005, 12:33 AM

Edit Log: