rnj has asked for the wisdom of the Perl Monks concerning the following question:
I have been using a program modified from Perl Cookbook by Christansen and Torkington (1998) to send myself reminder emails from my own computer to same computer. These emails have shown up in mutt and alpine. Now I have switched to Thunderbird but apparently it does not read /var/spool/mail. Any suggestions for a solution?
#!/usr/bin/perl -w # # ~/CRON/email-reminder-1.0.pl # # NB Sendmail slow with lan off, i.e. 5 mins. # # 20130720 # 20120108: email-reminder.pl # Cookbook p650 # # Uses file ~/DATES to check for Birthdays, Weddings, # Doctors, and Appointments. If finds any in 7days sends email to # ANOther@computer.home.net # # 20120111: email-reminder-1.0.pl updated to change # check for Doctors at 3 days # # DATES format "January x Birthday|Wedding|Doctor|Appointment" # # $blank=" "; $_=`date --date="+7 day" +%B,%_d`; s/, / /; s/,/ /; chomp; $match=$_.$blank; open (DOT_CAL,"/home/ANOther/DATES"); while (<DOT_CAL>){ if (/$match/){ if (/Birthday|Wedding/){ $Reminder=$_; mail_reminder() }else{ } } } close (DOT_CAL); $_=`date --date="+3 day" +%B,%_d`; s/, / /; s/,/ /; chomp; $match=$_.$blank; open (DOT_CAL,"/home/ANOther/DATES"); while (<DOT_CAL>){ if (/$match/){ if (/Doctor|Appointment/){ $Reminder=$_; print "D2 DATES[]= ",$_," Doctor or Appointment match \n"; mail_reminder() }else{ } } } close (DOT_CAL); sub mail_reminder{ use Mail::Mailer; $New_Reminder="Reminder"; $From_address="ANOther@computer.home.net"; $To_address="ANOther@192.168.1.171"; $mailer = Mail::Mailer->new(); $mailer->open({ From =>$From_address, To =>$To_address, Subject =>$New_Reminder, }); print $mailer $Reminder; print "we arrived here\n"; print "mailer= ",$mailer," Reminder= ",$Reminder,"\n"; $mailer->close() or die "Can't send: $!\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Mail::Mailer and Thunderbird
by hippo (Archbishop) on Apr 21, 2015 at 21:40 UTC | |
|
Re: Mail::Mailer and Thunderbird
by ww (Archbishop) on Apr 21, 2015 at 21:48 UTC | |
|
Re: Mail::Mailer and Thunderbird
by Aldebaran (Curate) on Apr 22, 2015 at 19:39 UTC | |
by afoken (Chancellor) on Apr 22, 2015 at 21:07 UTC |