Skip to content

Instantly share code, notes, and snippets.

@nanaelie
Created May 26, 2025 04:23
Show Gist options
  • Save nanaelie/cfffe37450c6b0801e2568b1801bd886 to your computer and use it in GitHub Desktop.
Save nanaelie/cfffe37450c6b0801e2568b1801bd886 to your computer and use it in GitHub Desktop.
import mailgrab as mgb # or from mailgrab import *
# Validate the path to a file containing emails
path = mgb.validate_path("file.txt")
# Read file content
with open(path, "r") as f:
content = f.read()
# Extract emails from content
emails = mgb.extract_emails(content)
# Display emails using the built-in printer
mgb.print_emails(emails)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment