Here is the first file and second file. Documentation of this file is at
http://tech.irt.org/articles/js124/Being a newbie perl programmer, I didn't have to know much to use this. So I typed it up and it works everytime there is an upload as long as you reference it in the post proceesing part of the album.cfg file. This is the first file. The other two are your notify file, which holds the e-mail address. The third file is a message. I chose to do a third file for programming benefits. For instance, if I change the message, I don't have to worry about going into the script and changing that and possible messing it up. So here ya go.
********************I named this send.pl but you can name it anything, just know where you put it.
open(EMAIL, "/home/www/albums/notify.txt") or die "cannot open email: $!";
flock(EMAIL, 2) or die "cannot locl email for exclusive access: $!";
open(MESSAGE, "/home/www/albums/msg.txt") or die "cannot open message: $!";
flock(MESSAGE, 2) or die "cannot lock message exclusively: $!";
my @msgfile = <MESSAGE>; # read it into @msgfile
close (MESSAGE) or die "cannot close message file: $!";
my @email_list = <EMAIL>;
close (EMAIL) or die "cannot close email list: $!";
foreach $address (@email_list)
{
chomp($address);
open (SENDMAIL, "|sendmail -t") or die "cannot open sendmail: $!";
print SENDMAIL "To: $address\n";
print SENDMAIL "From: Your Name <user\@yourdomain.com>\n";
print SENDMAIL "Subject: New Pictures Have Been Uploaded!!\n\n";
print SENDMAIL @msgfile;
}
*************************************I named this one msg.txt but again name it whatever you feel like
Hello Everyone,
Just wanted to let everyone know that new pictures have been added to the web site. Check them out at
http://www.yoursite.com. For your convenience, here is the link to the recent uploads page:
http://www.yoursite.com/cgi-bin/album.pl?album=:recent. We hope you all enjoy the pictures.
Love,
Your Name