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
7007f164
Commit
7007f164
authored
Feb 26, 2020
by
赵威
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update email
parent
4dcbd428
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
10 deletions
+14
-10
dist_update_portrait_market.py
eda/smart_rank/dist_update_portrait_market.py
+14
-10
No files found.
eda/smart_rank/dist_update_portrait_market.py
View file @
7007f164
...
...
@@ -22,11 +22,11 @@ from pyspark.sql.functions import concat_ws
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'
)
...
...
@@ -37,12 +37,16 @@ def send_email(app,id,e):
# 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