-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
5 additions
and
5 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,9 +15,9 @@ def _format_addr(s): | |
return formataddr((Header(name, 'utf-8').encode(), addr)) | ||
|
||
checi() | ||
from_addr = '[email protected]' | ||
password = 'shmuavhzsdgobbdg' | ||
smtp_server = 'smtp.qq.com' | ||
from_addr = '' #发送邮箱 | ||
password = '' #接收邮箱 | ||
smtp_server = 'smtp.qq.com' #服务器 | ||
|
||
# 普通列车 | ||
msg = MIMEText(che_num + '次列车还有, '+checi()[0]+' 张无座车票,'+checi()[1]+' 张硬座车票,'+checi()[2]+' 张硬卧车票,'+checi()[3]+' 张软卧车票。'+'\n' | ||
|
@@ -39,7 +39,7 @@ def _format_addr(s): | |
msg1['To'] = _format_addr('亲爱的 <%s>' % to_addr) | ||
msg1['Subject'] = Header(che_num + '次列车24小时监控', 'utf-8').encode() | ||
|
||
server = smtplib.SMTP_SSL(smtp_server, 465) | ||
server = smtplib.SMTP_SSL(smtp_server, 465) #smtp模式和接口 | ||
server.set_debuglevel(1) | ||
server.login(from_addr, password) | ||
if che_num[0] == 'G' or che_num[0] == 'D': | ||
|
@@ -2700,4 +2700,4 @@ def panduan(): | |
email() | ||
|
||
while True: | ||
panduan() | ||
panduan() |