Python Cheat Sheet

SMTP Mailer

import smtplib

server = smtplib.SMTP_SSL('smtp.server.com', 465)
headers = """From: Service <from@address.com>
To: <to@address.com>
Subject: Subject\n
gesendet von Pyton Mailer\n
"""
server.ehlo
server.login("username", "password")
server.sendmail(
  "from@address.com", 
  "to@address.com", 
  headers )
server.quit()

Web Server

python3 -m http.server 8080 --bind 10.10.14.120

Schreibe einen Kommentar