Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 32b4604

Browse files
💕(day14): 补充 Day14-B 笔记
1 parent b5a62d0 commit 32b4604

File tree

2 files changed

+55
-5
lines changed

2 files changed

+55
-5
lines changed

‎README.md‎

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ Python 100 天从新手到大师个人学习笔记与实践。
142142
- [x] 使用进程 - fork函数 / multiprocessing模块 / 进程池 / 进程间通信
143143
- [x] 使用线程 - thread模块 / threading模块 / Thread类 / Lock类 / Condition类 / 线程池
144144

145-
#### Day14-A - [网络编程入门](./Day01-15/Day14-A/网络编程入门.md)
145+
#### Day14-A - [网络编程入门](./Day01-15/Day14-A/网络编程入门.md)
146146

147147
学习笔记:[Day14-A 学习笔记](/day14-a/index.md)
148148

@@ -152,10 +152,25 @@ Python 100 天从新手到大师个人学习笔记与实践。
152152

153153
#### Day14-B - [网络应用开发](./Day01-15/Day14-B/网络应用开发.md)
154154

155-
- 访问网络API - 网络API概述 / 访问URL / requests模块 / 解析JSON格式数据
156-
- 文件传输 - FTP协议 / ftplib模块 / 交互式FTP应用
157-
- 电子邮件 - SMTP协议 / POP3协议 / IMAP协议 / smtplib模块 / poplib模块 / imaplib模块
158-
- 短信服务 - twilio模块 / 国内的短信服务
155+
- 访问网络API
156+
- 网络API概述
157+
- 访问URL
158+
- requests模块
159+
- 解析JSON格式数据
160+
- 文件传输
161+
- FTP协议
162+
- ftplib模块
163+
- 交互式FTP应用
164+
- 电子邮件
165+
- [x] SMTP协议
166+
- POP3协议
167+
- IMAP协议
168+
- [x] smtplib模块
169+
- poplib模块
170+
- imaplib模块
171+
- 短信服务
172+
- twilio模块
173+
- [x] 国内的短信服务
159174

160175
#### Day15 - [图像和文档处理](./Day01-15/Day15/图像和办公文档处理.md)
161176

‎day14-b/index.md‎

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Day14-B 网络应用开发
2+
3+
## 发送邮件
4+
5+
- SMTP(简单邮件传输协议):建立在 TCP 上的协议
6+
- Python 模块 `smtplib`
7+
8+
```python
9+
from smtplib import SMTP
10+
from email.header import Header
11+
from email.mime.text import MIMEText
12+
13+
14+
def main():
15+
# 请自行修改下面的邮件发送者和接收者
16+
sender = 'abcdefg@126.com'
17+
receivers = ['uvwxyz@qq.com', 'uvwxyz@126.com']
18+
message = MIMEText('用Python发送邮件的示例代码.', 'plain', 'utf-8')
19+
message['From'] = Header('王大锤', 'utf-8')
20+
message['To'] = Header('骆昊', 'utf-8')
21+
message['Subject'] = Header('示例代码实验邮件', 'utf-8')
22+
smtper = SMTP('smtp.126.com')
23+
# 请自行修改下面的登录口令
24+
smtper.login(sender, 'secretpass')
25+
smtper.sendmail(sender, receivers, message.as_string())
26+
print('邮件发送完成!')
27+
28+
29+
if __name__ == '__main__':
30+
main()
31+
```
32+
33+
## 发送短信
34+
35+
- 短信平台,调用 API 接口

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /