Skip to content

AaryaButolia11/birthday-wisher-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

🎉 Automated Birthday Wisher (Python)

A simple and customizable Python script that automatically sends birthday wishes via email using SMTP. This script runs daily (scheduled on PythonAnywhere) and sends a personalized email to anyone whose birthday matches the current date.


✨ Features

  • 🗓 Automatically checks birthdays daily
  • 📬 Sends personalized birthday emails using Gmail SMTP
  • 📁 Uses customizable message templates
  • 🔒 Keeps your credentials safe using environment variables
  • ☁️ Hosted and scheduled to run daily via PythonAnywhere

🚀 Tech Stack

Tech Purpose
Python 3 Core programming language
pandas Reading and managing CSV data
smtplib Sending emails via Gmail SMTP
datetime Working with current date and time
random Randomly selecting letter templates
dotenv (optional) Loading environment variables securely
PythonAnywhere Hosting and scheduling the automation
Anaconda Environment and package management

Screenshot of mail recieved

WhatsApp Image 2025-05-12 at 01 36 22_65044fe1

Script runs on cloud daily

WhatsApp Image 2025-05-12 at 01 37 15_0fe6c291


🔧 Project Structure

birthday-wisher/

├── birthdays.csv # List of birthdays (name, email, date)
├── main.py # Main script that runs daily
├── .env # Stores secure credentials (not committed)
├── letter_templates/
│ ├── letter_1.txt
│ ├── letter_2.txt
│ └── letter_3.txt
├── requirements.txt # Required Python packages
└── README.md # This file


📁 Sample CSV Format (birthdays.csv)

name,email,year,month,day
Alex,alex.doe@example.com,1990,05,12
Jamie,jamie.smith@example.com,1985,11,18
Taylor,taylor.jordan@example.com,1977,08,30
Morgan,morgan.lee@example.com,1972,09,21

⚙️ Setup Instructions (Local)

Clone the repository

git clone https://github.com/yourusername/birthday-wisher.git
cd birthday-wisher

Install dependencies

pip install pandas

Add credentials to environment variables

Create a .env file (do not upload it to GitHub):

EMAIL_USER=your_email@gmail.com
EMAIL_PASS=your_app_password

Run the script manually

python main.py

Hosting on PythonAnywhere (Scheduled Daily at 12 PM)

You can host and run this project for free on PythonAnywhere:

Create an account and upload your project.

Navigate to the Tasks tab.

Schedule your script (e.g., main.py) to run at 12:00 PM every day.

Make sure your Python version matches the one used in Anaconda (Python 3.10 or 3.11).

Set up environment variables in the PythonAnywhere dashboard or use .env.

🧠 How It Works

Loads today's date and compares it to the birthday entries.

If a match is found, it picks a random letter template.

Replaces [NAME] in the template with the actual name.

Sends the email using Gmail’s SMTP server.

About

The Automated Birthday Wisher is a Python-based script that reads a list of birthdays from a CSV file and sends personalized birthday emails using pre-written templates via Gmail SMTP. It's hosted on PythonAnywhere to run automatically every day at 12 PM, ensuring your loved ones never miss a birthday greeting.

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages