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.
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 :
ashutoshkrris / Automated-Birthday-Wisher
This is a program which will automatically send birthday wishes to your friends using your gmail credentials.
I will also soon be publishing it on GeeksforGeeks.
Top comments (0)