简明 Python 教程: http://woodpecker.org.cn/abyteofpython_cn/chinese/
一开始通读一遍这个很不错,是最简单明确的 Python 教程,最适合快速了解。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import smtplib | |
| from getpass import getpass | |
| def prompt(prompt): | |
| return input(prompt).strip() | |
| fromaddr = prompt("From: ") | |
| toaddrs = prompt("To: ").split() | |
| subject = prompt("Subject: ") | |
| print("Enter message, end with ^D (Unix) or ^Z (Windows):") |