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
ed669c47
Commit
ed669c47
authored
Feb 14, 2019
by
张彦钊
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加发送邮件功能
parent
c1631787
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
0 deletions
+36
-0
send_mail.py
eda/esmm/Model_pipline/send_mail.py
+34
-0
submit.sh
eda/esmm/Model_pipline/submit.sh
+2
-0
No files found.
eda/esmm/Model_pipline/send_mail.py
0 → 100644
View file @
ed669c47
#coding=utf-8
import
smtplib
from
email.mime.text
import
MIMEText
from
email.utils
import
formataddr
import
datetime
my_sender
=
'gaoyazhe@igengmei.com'
my_pass
=
'VCrKTui99a7ALhiK'
my_user1
=
'gaoyazhe@igengmei.com'
my_user2
=
'zhangyanzhao@igengmei.com'
def
mail
():
ret
=
True
try
:
with
open
(
'/home/gmuser/esmm_data/submit.log'
)
as
f
:
stat_data
=
f
.
read
()
msg
=
MIMEText
(
stat_data
,
'plain'
,
'utf-8'
)
msg
[
'From'
]
=
formataddr
([
"高雅喆"
,
my_sender
])
msg
[
'To'
]
=
my_user1
+
','
+
my_user2
msg
[
'Subject'
]
=
str
(
datetime
.
date
.
today
())
+
"-esmm多目标模型训练指标统计"
server
=
smtplib
.
SMTP_SSL
(
"smtp.exmail.qq.com"
,
465
)
server
.
login
(
my_sender
,
my_pass
)
server
.
sendmail
(
my_sender
,[
my_user1
,
my_user2
],
msg
.
as_string
())
server
.
quit
()
except
Exception
:
ret
=
False
return
ret
ret
=
mail
()
if
ret
:
print
(
"邮件发送成功"
)
else
:
print
(
"邮件发送失败"
)
\ No newline at end of file
eda/esmm/Model_pipline/submit.sh
View file @
ed669c47
...
...
@@ -45,3 +45,5 @@ ${PYTHON_PATH} ${MODEL_PATH}/train.py --ctr_task_wgt=0.9 --learning_rate=0.0001
echo
"sort and 2sql"
${
PYTHON_PATH
}
${
MODEL_PATH
}
/to_database.py
${
PYTHON_PATH
}
${
MODEL_PATH
}
/Model_pipline/send_mail.py
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