We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5f8a8e8 commit 520b4a5Copy full SHA for 520b4a5
yxwz.py
@@ -0,0 +1,24 @@
1
+#-*- coding:'utf-8' -*-
2
+import smtplib
3
+from email.mime.text import MIMEText
4
+from email.header import Header
5
+zhengwen=input('请输入正文:')
6
+fajianr=input('请输入发件人:')
7
+shoujianr=input('请输入收件人:')
8
+zhuti=input('主题:')
9
+messeng=MIMEText(zhengwen,'plain','utf-8')#正文
10
+messeng['From']=Header(fajianr,'utf-8')#发件人
11
+messeng['TO']=Header(shoujianr,'utf-8')#收件人
12
+subject=zhuti#主题
13
+messeng['Subject']=Header(subject,'utf-8')
14
+def yxwz():
15
+ try:
16
+ smtp=smtplib.SMTP()
17
+ smtp.connect('smtp.sohu.com','25')
18
+ smtp.login('你的搜狐邮箱','你搜狐的密码')
19
+ smtp.sendmail('你的搜狐邮箱'['目标邮箱'],messeng.as_string())
20
+ smtp.quit()
21
+ print('[*]邮件发送成功')
22
+ except Exception as e:
23
+ print('[-]发送失败,报错原因:',e)
24
+yxwz()
0 commit comments