Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
ffm-baseline
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ML
ffm-baseline
Commits
e3c74a82
Commit
e3c74a82
authored
Feb 26, 2020
by
赵威
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update email
parent
f79d289d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
11 deletions
+14
-11
tool.py
eda/smart_rank/tool.py
+14
-11
No files found.
eda/smart_rank/tool.py
View file @
e3c74a82
...
...
@@ -19,11 +19,11 @@ import traceback
def
send_email
(
app
,
id
,
e
):
# 第三方 SMTP 服务
mail_host
=
'smtp.exmail.qq.com'
# 设置服务器
mail_user
=
"
gaoyazhe
@igengmei.com"
# 用户名
mail_pass
=
"
VCrKTui99a7ALhiK
"
# 口令
mail_user
=
"
zhaowei
@igengmei.com"
# 用户名
mail_pass
=
"
Gengmei1234
"
# 口令
sender
=
'
gaoyazhe
@igengmei.com'
receivers
=
[
'
gaoyazhe
@igengmei.com'
]
# 接收邮件,可设置为你的QQ邮箱或者其他邮箱
sender
=
'
zhaowei
@igengmei.com'
receivers
=
[
'
zhaowei
@igengmei.com'
]
# 接收邮件,可设置为你的QQ邮箱或者其他邮箱
e
=
str
(
e
)
msg
=
MIMEMultipart
()
part
=
MIMEText
(
'app_id:'
+
id
+
':fail'
,
'plain'
,
'utf-8'
)
...
...
@@ -32,14 +32,17 @@ def send_email(app,id,e):
# 括号里的对应收件人邮箱昵称、收件人邮箱账号
msg
[
'To'
]
=
";"
.
join
(
receivers
)
# message['Cc'] = ";".join(cc_reciver)
msg
[
'Subject'
]
=
'spark streaming:app_name:'
+
app
with
open
(
'error.txt'
,
'w'
)
as
f
:
f
.
write
(
e
)
f
.
close
()
part
=
MIMEApplication
(
open
(
'error.txt'
,
'r'
)
.
read
())
part
.
add_header
(
'Content-Disposition'
,
'attachment'
,
filename
=
"error.txt"
)
msg
.
attach
(
part
)
try
:
with
open
(
'error.txt'
,
'w'
)
as
f
:
f
.
write
(
e
)
f
.
close
()
part
=
MIMEApplication
(
open
(
'error.txt'
,
'r'
)
.
read
())
part
.
add_header
(
'Content-Disposition'
,
'attachment'
,
filename
=
"error.txt"
)
msg
.
attach
(
part
)
except
Exception
as
e
:
print
(
e
)
try
:
smtpObj
=
smtplib
.
SMTP_SSL
(
mail_host
,
465
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment