Automated Birthday Wisher using Python

Hello guys, To kaise hain aaplog?
Ashutosh here again with another Python mini project.

Are you bored of sending birthday wishes to your friends (well,some people are) or do you forget to send wishes to your friends or do you want to wish them at 12 AM but you always fall asleep? Why not automate this simple task using our friend, Python!!!

To chaliye shuru karte hain…
The first thing you have to do is to install pandas on your system using pip install pandas command. We shall use datetime module and SMTP library here to send the mail.
Also create an excel sheet containing Name , Email , Contact, Birthday and Year.

Let me show you my code :

Wisher program

First thing we do is import five libraries : pandas, datetime, smtplib, requests and win10toast.
Then we put our gmail credentials in order to login. We define a sendEmail() function which will start a gmail session , send the email and quit the session.

For the SMS part, we must have an account on www.fast2sms.com from where we will get an API key. This API key is used to send SMS over mobile numbers using your account on fast2sms. We have a sendsms() function which will verify the API key and send SMS.

In the main function, we read the excel sheet and match today’s date with any of the birthdays. If there is a match, we call the sendEmail() and sendsms() functions and also we add the current year in the excel sheet.

Also, we have used ToastNotifier from win10toast library to show desktop notifications once the e-mail and SMS has been sent successfully.

To automate the task, we use Task Scheduler in Windows. I have mentioned all the steps to automate the task in my Github repository :

I will also soon be publishing it on GeeksforGeeks.

If you liked my work, please support by giving claps on Medium or starring my Github repository. Thanks, in advance 🤗

If you face any problem or rectify anything in the above program, feel free to contact me : Ashutosh Krishna (ashutoshbritish@gmail.com)

Student | Backend Developer | Python | ashutoshkrris.tk | iread.ga

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store