#!/bin/ksh
TODAY_DATE=`date +'%m%d'`
BIRTHDAY_FILE=birthday
RECIPIENTS="your mail ID"
TO_BE_MAILED=mail
NAME=`grep $TODAY_DATE birthday|awk '{FS=" "} {print $2}'`
if [[ -n $NAME ]];
then
echo "To: $RECIPIENTS">$TO_BE_MAILED
echo "Subject: Birthday Reminder" >>$TO_BE_MAILED
echo "Mime-Version: 1.0">>$TO_BE_MAILED
echo "Content-Type: text/html" >>$TO_BE_MAILED
echo "<><>">>$TO_BE_MAILED
echo "< equiv ="\" content="\" charset="UTF-8\">">>"$TO_BE_MAILED
echo "< /HEAD><>">>$TO_BE_MAILED
echo "Today is $NAME's birthday">>$TO_BE_MAILED
echo "< /BODY>< /HTML>">>$TO_BE_MAILED
`cat $TO_BE_MAILED|/usr/lib/sendmail -t `
fi
You can refine and modify it according to your needs. I just was too lazy to improve it once it started working.Add the script to your ".profile". And as soon as you login you will get an email reminding you of any birthday :). One important thing, because blogger doesnt allow me to write HTML tags i have added space before ever HTML tag, please remove that .All birthday's are saved in a file named birthday in the below format : birthday , followed by name
0101 PAPA
0202 MUMMY
0303 SIS
6 comments:
Awesome dude ...
Just a lil doubt:
What SMTP server will sendmail use ?
dunno :)..
There is one running on each of our machines so didnt care to think :P
Nerd !!!
:)
bhai ab tu aisa bole ? :P
Yaar, it still means ki I have to send the birthday greeting/orkut and facebook message. How abt this script directly doing the next steps along with sending me the reminder :D
hahaha..Ronny ye Beta version hai...final release might include new feature :P
Post a Comment