Carol,
Hi there...Again, glad that you back with us.
I decided to start a new thread since the older Thread was getting quite long.
This Thread is a continuation of the following Thread:
http://www.gossamer-threads.com/scripts/forum/resources/Forum12/HTML/000628.html
Okay, I think I have identified the problem with this mod. I have added a print statement to see what is being pulled from the database and I notice that email addresses seem to be printing all on one line. What I think I need to do is have the email addresses print on separate lines before sending the email message.
Here is what I have (to re-cap):
# Required Files
#############################################################
require $mailer_path . "/Mailer.pm";
##############################################################
# Begin Script
#############################################################
@referers = ('http://www.coco.cc.az.us','http://wookie.coco.cc.az.us','http://spock.coco.cc.az.us');
&Check_URL;
#############################################################
# Open the Database
#############################################################
open (DB, "<$db_path/$db_file_name") or ("unable to open password file. Reason: $!\n");
if ($db_use_flock) {
flock(DB, 2);
}
@lines = <DB>;
#############################################################
# Start Loop
#############################################################
foreach $line (@lines) {
@data = split /\|/, $line;
$email = $data[21];
$user = $data[3];
print "$email\n";
}
if (!$data[21]) {
print "Content-type: text/html\n\n";
print "No Email Address or User Name defined in $db_path/$db_file_name!";
exit;
}
close DB;
if (($user) && ($email)) {
#############################################################
# Mail Routine
#############################################################
my $mailer = new Mailer ( { smtp => 'yoda.coco.cc.az.us' } )
or die "Can't init mailer: $Mailer::error";
$mailer->send ( {
to => '$email',
from => '$admin_mail',
subject => "NT Web Account Created",
msg => $notify_body_text
} )
or die "Can't send mail: $Mailer::error";
}
#############################################################
# Print to Log File
#############################################################
&logging;
##################################################################
# END SCRIPT
##################################################################
The output of this file when I execute it from the web browser is the following:
dlokon@anthrotech.com
lgallego@anthrotech.com minigo@anthrotech.com mmckinst@anthrotech.com shill@anthrotech.com vfishco@anthrotech.com
twymore@anthrotech.com tmckever@anthrotech.com snittman@anthrotech.com rbradfor@anthrotech.com
jrhode@anthrotech.com brunke@anthrotech.com cshirley@anthrotech.com dmacias@anthrotech.com ejones@anthrotech.com jgroos@anthrotech.com mostrows@anthrotech.com eliot@anthrotech.com
dbrown@anthrotech.com psprengl@anthrotech.com mlainoff@anthrotech.com bswanson@besy.anthrotech.com ksalt@anthrotech.com
mbaker@anthrotech.com kkozak@anthrotech.com bcress@anthrotech.com bmurphy@anthrotech.com dfischo@anthrotech.com gcurd@anthrotech.com jbradley@anthrotech.com rcalvin@anthrotech.com
rfoster@anthrotech.com
pholbroo@anthrotech.com Content-type: text/plain
I think what I need for this to work with our SMTP server is to have the email addresses on separate lines, like the following:
email2
email3
email4
email5
Any additional thoughts you have for making this work would be greatly appreciated. Also, there have been about three or four other DBMAN users who would like to have this type of script for their database projects.
Thanks in advance.
Regards,
------------------
Eliot Lee
Founder and Editor
Anthro TECH, L.L.C
http://www.anthrotech.com/
info@anthrotech.com
==========================
Coconino Community College
http://www.coco.cc.az.us/
Web Technology
Coordinator
elee@coco.cc.az.us
[This message has been edited by Eliot (edited September 23, 1999).]
[This message has been edited by Eliot (edited September 23, 1999).]
Hi there...Again, glad that you back with us.
I decided to start a new thread since the older Thread was getting quite long.
This Thread is a continuation of the following Thread:
http://www.gossamer-threads.com/scripts/forum/resources/Forum12/HTML/000628.html
Okay, I think I have identified the problem with this mod. I have added a print statement to see what is being pulled from the database and I notice that email addresses seem to be printing all on one line. What I think I need to do is have the email addresses print on separate lines before sending the email message.
Here is what I have (to re-cap):
Code:
############################################################# # Required Files
#############################################################
require $mailer_path . "/Mailer.pm";
##############################################################
# Begin Script
#############################################################
@referers = ('http://www.coco.cc.az.us','http://wookie.coco.cc.az.us','http://spock.coco.cc.az.us');
&Check_URL;
#############################################################
# Open the Database
#############################################################
open (DB, "<$db_path/$db_file_name") or ("unable to open password file. Reason: $!\n");
if ($db_use_flock) {
flock(DB, 2);
}
@lines = <DB>;
#############################################################
# Start Loop
#############################################################
foreach $line (@lines) {
@data = split /\|/, $line;
$email = $data[21];
$user = $data[3];
print "$email\n";
}
if (!$data[21]) {
print "Content-type: text/html\n\n";
print "No Email Address or User Name defined in $db_path/$db_file_name!";
exit;
}
close DB;
if (($user) && ($email)) {
#############################################################
# Mail Routine
#############################################################
my $mailer = new Mailer ( { smtp => 'yoda.coco.cc.az.us' } )
or die "Can't init mailer: $Mailer::error";
$mailer->send ( {
to => '$email',
from => '$admin_mail',
subject => "NT Web Account Created",
msg => $notify_body_text
} )
or die "Can't send mail: $Mailer::error";
}
#############################################################
# Print to Log File
#############################################################
&logging;
##################################################################
# END SCRIPT
##################################################################
The output of this file when I execute it from the web browser is the following:
Code:
lhill@anthrotech.com aolson@anthrotech.com apeterse@anthrotech.com brybates@anthrotech.com cnation@flagstaff.az.us dlokon@anthrotech.com
lgallego@anthrotech.com minigo@anthrotech.com mmckinst@anthrotech.com shill@anthrotech.com vfishco@anthrotech.com
twymore@anthrotech.com tmckever@anthrotech.com snittman@anthrotech.com rbradfor@anthrotech.com
jrhode@anthrotech.com brunke@anthrotech.com cshirley@anthrotech.com dmacias@anthrotech.com ejones@anthrotech.com jgroos@anthrotech.com mostrows@anthrotech.com eliot@anthrotech.com
dbrown@anthrotech.com psprengl@anthrotech.com mlainoff@anthrotech.com bswanson@besy.anthrotech.com ksalt@anthrotech.com
mbaker@anthrotech.com kkozak@anthrotech.com bcress@anthrotech.com bmurphy@anthrotech.com dfischo@anthrotech.com gcurd@anthrotech.com jbradley@anthrotech.com rcalvin@anthrotech.com
rfoster@anthrotech.com
pholbroo@anthrotech.com Content-type: text/plain
I think what I need for this to work with our SMTP server is to have the email addresses on separate lines, like the following:
Code:
email1 email2
email3
email4
email5
Any additional thoughts you have for making this work would be greatly appreciated. Also, there have been about three or four other DBMAN users who would like to have this type of script for their database projects.
Thanks in advance.
Regards,
------------------
Eliot Lee
Founder and Editor
Anthro TECH, L.L.C
http://www.anthrotech.com/
info@anthrotech.com
==========================
Coconino Community College
http://www.coco.cc.az.us/
Web Technology
Coordinator
elee@coco.cc.az.us
[This message has been edited by Eliot (edited September 23, 1999).]
[This message has been edited by Eliot (edited September 23, 1999).]