using time as trigger in sending notification mail
hi, everybody!
how is time used to trigger the sending of an e-mail? you will find below a script that will send an e-mail if (a) var1 eq var2 and (b) once there is user action (e.g., a user clicking on a button to execute the script). but what if there is no user and there is only server-time as a trigger?
-----
# assume that $server_time is generated using "localtime (time)"
# while $expiration_date is user-defined and in the same
# format as $server_time.
if ($server_time eq $expiration_date) # change needed here to make time
{ # the trigger in sending a notification
open (M, "|/usr/sbin/sendmail -t"); # mail.
select (M);
print M "To: email\@client.com\n";
print M "From: email\@service_provider.com\n";
print M "Subject: expired subscription\n\n";