Running a small business means drowning in repetitive emails. Here's how I automated mine with Python in one afternoon.
The Problem
Every week I was spending 3-4 hours:
Sending follow-up emails to clients who hadn't paid
Sending weekly status reports to 10+ clients
Replying to the same 5 "how do I do X?" questions
Manually forwarding supplier invoices to accounting
The Solution: A Python Email Bot
Setup
import smtplib import imaplib import email from email.mime.text import MIMEText from email.mime.multipart import MIMEMultipart from datetime import datetime , timedelta import schedule import time
Enter fullscreen mode
Exit fullscreen mode
1. Automated Payment Follow-Up Emails
import sqlite3 from datetime import date , timedelta
def check_overdue_invoices (): conn = sqlite3 . connect ( ' invoices.db ' ) cursor = conn . cursor ()
# Find invoices overdue by 7+ days overdue_date = date . today () - timedelta ( days = 7 ) cursor .…