
Built a tool to auto-reply to emails. Now I reply to spam faster than real people.
Built a tool to auto reply to emails. Now I reply to spam faster than real people. Was getting 30 cold emails a day minimum. Recruiters, sales pitches, people asking if I want to buy their course. Started replying manually with "not interested" but that ate 20 minutes every morning. Thought hey I can automate this. Version 1 was embarrassingly simple Wrote a Python script that checked my Gmail every 5 minutes and sent "Thanks but not interested" to anything with keywords like "opportunity" or "partnership" in the subject. import imaplib import smtplib from email.mime.text import MIMEText imap = imaplib . IMAP4_SSL ( ' imap.gmail.com ' ) imap . login ( ' user@gmail.com ' , ' password ' ) imap . select ( ' INBOX ' ) status , messages = imap . search ( None , ' UNSEEN SUBJECT " opportunity "' ) for num in messages [ 0 ]. split (): msg = MIMEText ( ' Thanks but not interested ' ) msg [ ' Subject ' ] = ' Re: ... ' smtp = smtplib . SMTP ( ' smtp.gmail.com ' , 587 ) smtp . sendmail ( ' user@g
Continue reading on Dev.to
Opens in a new tab


