Benutzer-Werkzeuge

Webseiten-Werkzeuge


prog:python:networking

Python Networking

UDP Sockets

Python Requests

Interacting with HTTP Services As a Client

TCP Sockets

Packet Capture & Generation

Packet Dissection

Routing

Event-driven networking

Send Email

# connect to your Email-Server and send Hello Message (ehlo)
smtpObj = smtplib.SMTP('smtp.example.com', 587)
smtpObj.ehlo()
# start TLS encryption for security
smtpObj.starttls()
# login to the Email-Server with your own username/password
smtpObj.login('bob@example.com', 'PASSWORD')
# send Email from Bob to Alice. Email-Headers are text-fields on separate lines. 
# the Email-Body is separated by an empty line from the header. 
smtpObj.sendmail('bob@example.com', 'alice@example.com', 'Subject:Just a Test\nDate:20171208\nFrom:bob@example.com\n\nThis is a test-mail. Ignore!')
# disconnect from Mailserver
smtpObj.quit()
prog/python/networking.txt · Zuletzt geändert: 2019/01/30 08:46 von admin