prog:python:networking
Dies ist eine alte Version des Dokuments!
Inhaltsverzeichnis
Python Networking
UDP Sockets
Interacting with HTTP Services As a Client
TCP Sockets
Packet Capture & Generation
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.1526924222.txt.gz · Zuletzt geändert: 2018/05/21 17:37 von admin