Hi again all,
I am trying to write a postcard script for a friends site, and am running into a problem that has me scratching my head......
He wants the sender to be notified when the card is picked up, and I can get everything to work fine, except the confirmation email will not send. I have 2 other places in the script that mail is sent just fine, and I am using the same basic code to send this one.
I don't get any errors on the server logs, it just doesn't send.
The &print_html; that is right after the ¬ify; executes perfectly, it is just like it isn't calling the ¬ify sub at all.....
Any ideas/advice will be greatly appreciated.
Jim
I am trying to write a postcard script for a friends site, and am running into a problem that has me scratching my head......
He wants the sender to be notified when the card is picked up, and I can get everything to work fine, except the confirmation email will not send. I have 2 other places in the script that mail is sent just fine, and I am using the same basic code to send this one.
I don't get any errors on the server logs, it just doesn't send.
The &print_html; that is right after the ¬ify; executes perfectly, it is just like it isn't calling the ¬ify sub at all.....
Any ideas/advice will be greatly appreciated.
Jim
Code:
#######################################################
sub pickup_card {
#Open card.list file
open (DATABASE, "$cardlist") || &CgiDie ("I am sorry, but I was not able to open the
data file.");
flock (DATABASE, 2);
#Assign database to list array
@list = <DATABASE>;
flock (DATABASE, 8);
close (DATABASE);
#Split array into scalar variables
foreach $list (@list) {
($userid, $sender, $senderemail, $message, $name, $notify, $image, $date_time, $date) = split
(/\|/, $list);
#Compare form input to $userid
if ($input{'id_num'} eq $userid && $input{'id_num'} ne "") {
$test = 1;
¬ify;
&print_html;
}
}
if ($test == 0) {
&invalid_id;
}
}
<---
More subs snipped out of here --->
#######################################################
#Notify Sender that card was picked up
sub notify {
open(MAIL, "| /usr/sbin/sendmail -t") || die "Error";
$r = select(MAIL); $|=1;
print "To: $input{'senderemail'}\n";
print "From: postman\@thefarthing.com\n";
print "Subject: $input{'name'} has picked up their card!\n\n";
print "$input{'name'} has picked up their card that you sent\n";
print "from theFARthing.com!\n\n";
print "Thank you for using our card service and we hope\n";
print "that you return soon.\n\n";
print "theFARthing.com Team\n";
close (MAIL);
select($r);
}