Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
H
hexang_web
Manage
Activity
Members
Labels
Plan
Issues
1
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Kai Lee
hexang_web
Commits
703adc78
Commit
703adc78
authored
5 years ago
by
ktongxue2018
Browse files
Options
Downloads
Patches
Plain Diff
new file: mail_proxy/mail_proxy.py
parent
a44efa6e
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
mail_proxy/mail_proxy.py
+31
-0
31 additions, 0 deletions
mail_proxy/mail_proxy.py
with
31 additions
and
0 deletions
mail_proxy/mail_proxy.py
0 → 100644
+
31
−
0
View file @
703adc78
from
flask
import
Flask
,
request
from
yagmail
import
SMTP
from
base64
import
b64decode
def
send_mail
(
to_addr
,
content
):
s
=
SMTP
(
'
{email}
'
,
'
{password}
'
)
s
.
send
(
to
=
to_addr
,
subject
=
'
hexang.com
'
,
contents
=
content
)
app
=
Flask
(
__name__
)
@app.route
(
'
/send_mail/
'
,
methods
=
[
'
POST
'
])
def
send
():
to_addr
=
request
.
form
[
'
to
'
]
url
=
request
.
form
[
'
content
'
]
content
=
"""
Hi ,
This is hexang.
Please reset your account password through the following link:
{}
---
Best regards,
Team hexang
"""
.
format
(
url
)
send_mail
(
to_addr
,
content
)
if
__name__
==
'
__main__
'
:
app
.
run
(
host
=
'
0.0.0.0
'
,
port
=
8000
)
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment