Your Personalized Email Reminder Assistant (Windows m/c)— Using Python

In the hustle and bustle of our daily lives, it’s common to overlook important emails amid the chaos of work and daily tasks. But what if there was an easy solution? By creating our own email reminder assistant. We can ensure we never miss a crucial message again.
Let’s explore how to set up this simple yet effective tool, helping us stay organized and responsive in our digital communication.
Objective:
We’ll define our interval window and anticipate receiving pop-up notifications for all critical emails that require immediate action.
MS Outlook Initial Set Up:
To streamline email management, we’ll categorize all important emails into a designated folder within Outlook’s root folder structure. Below I’ve created my own EMAILNOTIFICATION folder.

Now will park all our important emails (read or unread) inside this folder that need our attention.
That’s it! Let’s move on to coding part.
Python Code:
I break the coding part into 3
1. Install required Libraries
2. Main Code
3. Create EXE and share with your team to use (Optional).
But, before getting into the coding part, let’s see how our assistant will look like, then it will be more easy to understand the code.

- Required Libraries:
pip install pywin32
pip install pyinstaller
pywin32 : Provides access to many of the Windows API functions. Here we need win32com.client module (comes under pywin32 library) to interact with Microsoft COM (Component Object Model) objects, like Outlook, Word, Excel etc.
pyinstaller : To create an executable file.
2. Mail Code:
It’s very simple and I’ve mentioned proper comments so will be easy for you to understand.
# Already installeed pywin32 and pyinstaller libraries
# tkinter comes along with python and used to create the GUI
import win32com.client
import tkinter as tk
from tkinter import messagebox
# Your Pop-Up message. Appears always on top
def show_popup(subject):
window.bell() # add window bell sound
popup = tk.Toplevel(window)
popup.title("Email Reminder")
popup.attributes("-topmost", True) # to stay on Top
# Your Message appears in Pop-Up window
popup_label = tk.Label(popup, text = f" Buddy follow Pomodoro Technique :-) and Don't forget to reply to the email with subject: {subject}")
popup_label.pack(padx=20, pady=10)
popup_button = tk.Button(popup, text="OK", command=popup.destroy)
popup_button.pack(pady=5)
# To enable the underlying logic by clicking Remind Button.
def reminder_button_clicked():
# 3 input parameters as per the above "EMAIL RREMINDER TOOL" pic
email = email_entry.get()
folder = folder_entry.get()
interval = int(interval_entry.get())
# Connect to Outlook
outlook = win32com.client.Dispatch("Outlook.Application")
namespace = outlook.GetNamespace("MAPI")
try:
# Specify the email and folder where your important emails are stored. TESTNOTIFICATION
root_folder = namespace.Folders.Item(email)
folder = root_folder.Folders.Item(folder)
# Get all emails
items = folder.Items
# In case you want pop-up only for UnRead emails then uncomment the below line
# unread_emails = items.Restrict("[UnRead] = True")
# Loop through all emails and display popup
# In case you want to iterate only through UnRead emails, then use "unread_emails" instead of "items" below
for email_items in items:
show_popup(email_items.Subject)
except Exception as e:
messagebox.showerror("Error", f"An error occurred: {e}")
# Releasing resource and cleaning up objects explicitly ensuring efficient memory usage
del outlook
# define the iteration of the pop-up notification in milliseconds
window.after(interval*1000, reminder_button_clicked)
# ----- Create the GUI and pass runtime arguments - email ID, foldername, Duration
window = tk.Tk()
window.title("Outlook Email Reminder")
# Create input fields for email ID
email_label = tk.Label(window, text="Email Address:")
email_label.grid(row=0, column=0, padx=10, pady=5, sticky=tk.E)
email_entry = tk.Entry(window)
email_entry.grid(row=0, column=1, padx=10, pady=5)
# Create input fields for Folder
folder_label = tk.Label(window, text="Folder Name:")
folder_label.grid(row=1, column=0, padx=10, pady=5, sticky=tk.E)
folder_entry = tk.Entry(window)
folder_entry.grid(row=1, column=1, padx=10, pady=5)
# Create input fields for Duration/Notification Interval
interval_label = tk.Label(window, text="Interval in Seconds:")
interval_label.grid(row=2, column=0, padx=10, pady=5, sticky=tk.E)
interval_entry = tk.Entry(window)
interval_entry.grid(row=2, column=1, padx=10, pady=5)
# Create button to trigger reminder
reminder_button = tk.Button(window, text="Remind", command=reminder_button_clicked)
reminder_button.grid(row=3, columnspan=2, padx=10, pady=10)
# Run the GUI
window.mainloop()
All set! Hope you already placed some emails. Now run this code. I’ve placed 2 emails inside my EMAILNOTIFICATION folder, and this is what I receive

Click OK to close these pop-up windows. I’ve defined 3600 seconds, so I will be getting pop-up in every 1hr interval. Don’t forget to move the email you already worked on else will be receiving unwanted reminders.
NOTE, if you want to change the Interval Time, please close the application and relaunch.
3. Create EXE and share with your team mates to use :
This step is only required if you want to create an .exe else you can ignore.
Go to your terminal and type pyinstaller followed by your .py file name and — onefile.
pyinstaller EmailNotificationGUIEXE.py --onefile
After successful execution go inside your project dir dist folder and you will find your EXE file. In may case :

Share this with your colleague!
Happy Learning !