A Python tool that sends application emails with a CV attachment through SMTP.
- Reads the email subject and body from a TOML configuration file.
- Reads SMTP credentials from a separate TOML file.
- Requires Python 3.13 or newer with no external packages.
- Skips email addresses that you already contacted.
The tool stores configuration files in ~/.config/send_cv/.
The script creates starter template files automatically on the first run.
File location: ~/.config/send_cv/credentials.toml
[smtp]
sender = "your.email@gmail.com"
password = "your-app-password"
host = "smtp.gmail.com"
port = 465If you use --dry-run, password is not necessary.
host and port are optional.
File location: ~/.config/send_cv/config.toml
subject = "Application for Summer Internship"
attachment_path = "~/Documents/cv.pdf"
message = """
Dear Hiring Team,
Please find attached my CV for your consideration.
Best regards,
"""attachment_path must be an absolute path or start with ~.
On Windows, use forward slashes or single quotes for the path:
- Forward slashes:
attachment_path = "C:/Users/name/Documents/cv.pdf" - Single quotes:
attachment_path = 'C:\Users\name\Documents\cv.pdf' - User directory:
attachment_path = "~/Documents/cv.pdf"
The script searches for files in this order:
- Command-line options:
--config,--credentials,--cv. - Current working directory:
./config.toml,./credentials.toml. - User configuration directory:
~/.config/send_cv/.
Preview the email output without sending:
python send_cv_mail.py -e recruiter@example.com --dry-runSend emails to a list from a file in batches of 3:
python send_cv_mail.py -f emails.txt -b 3Specify custom file paths:
python send_cv_mail.py -e recruiter@example.com --config ./custom_config.toml --cv ~/Downloads/new_cv.pdfThe tool writes sent addresses to sent_emails.log.
To change this file path, use the --sent-log option.
On the next run, the tool skips addresses that exist in this log.