Gossamer Forum
Home : Products : DBMan : Customization :

Internal Mass Mailer - send to all users from default.pass file

Quote Reply
Internal Mass Mailer - send to all users from default.pass file
Hello, I installed a Internal Mass Mailer -Mod - and it seems to work(I don't get any errors)! But e-mails are not be sent! The path to mail programm on my server is correct. I also use the Secure Password Lookup -Mod and it works! I think that Internal Mass Mailer-Mod needs the e-mail adresses stored in defauld.db file and not in default.pass file. Can I make so that Internal Mass Mailer-Mod will also use the emails stored in the default.pass? I hope you understand me. thanks in advance
Quote Reply
Re: [uhrwerk] Internal Mass Mailer - send to all users from default.pass file In reply to
I could be wrong but I think you will also need to store the email within the database record.


See if these threads will help:

Topic: Store email address in .pass file and in .db file
theovis2 13-Sep-00
http://gossamer-threads.com/p/105251

Also: http://gossamer-threads.com/p/105166

Unoffical DBMan FAQ

http://creativecomputingweb.com/dbman/index.shtml/
Quote Reply
Re: [LoisC] Internal Mass Mailer - send to all users from default.pass file In reply to
Hello, thanks for your reply! I want to use the database so that only I can create users! By creating a user I cann add the email adress and it will be stored in default.pass file. All users cannot make entries in the databank(except the admin). That's why it is difficult in my situation make so that the email adress will automaticly stored with entries because only I cann do that. I want to use the internal mass mailer (posted here http://www.jpdeni.com/.../Mods/massmailer.txt ) to send the email to registred users. How can I change this mod so that the all emails would be taken not from default.db file but from default.pass file? Do you know perhaps the best way to solve this problem or the alternative idea? should I first of all make changes in auth.pl and than use this value $user_email in db.cgi in sub mass_mail to send the emails? or not? thanks in advance
Quote Reply
Re: [uhrwerk] Internal Mass Mailer - send to all users from default.pass file In reply to
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