V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
kevinmissu
V2EX  ›  Python

本人小白 最近再学习 flask 最近最近有一个需求如下:用户上传一个文件,我们需要用户输入邮箱,然后把结果返回给邮箱 怎么操作求大神

  •  
  •   kevinmissu ·
    YangHuaidong · 2019-06-03 11:38:41 +08:00 · 1840 次点击
    这是一个创建于 1761 天前的主题,其中的信息可能已经有所发展或是发生改变。
    8 条回复    2019-06-04 14:30:56 +08:00
    AllenBigBear
        1
    AllenBigBear  
       2019-06-03 13:25:16 +08:00
    提供邮箱的目的是验证用户是真实存在的?还是啥。。。?
    结果返回邮箱是指上传成功与否的结果???
    xxx777
        2
    xxx777  
       2019-06-03 13:58:32 +08:00
    flask-mail 可以发送结果到邮箱
    kevinmissu
        3
    kevinmissu  
    OP
       2019-06-03 14:26:38 +08:00
    @AllenBigBear 提供邮箱的目的是返回用户提供数据后的结果
    kevinmissu
        4
    kevinmissu  
    OP
       2019-06-03 14:27:36 +08:00
    @xxx777 怎么发送到不同人的邮箱呢 这个 flask-mail 可以满足吗?
    SleipniR
        5
    SleipniR  
       2019-06-03 14:39:00 +08:00
    这是一个文件异步处理后结果发回邮箱的问题?
    如果上传的文件和填写的邮箱在同一 form 里面,那么在提交异步任务的时候将邮箱和文件同时提交,发送邮件的动作在异步处理程序完成文件处理后执行。
    anonymous256
        6
    anonymous256  
       2019-06-03 14:42:59 +08:00
    https://pythonhosted.org/Flask-Mail/
    One of the most basic functions in a web application is the ability to send emails to your users.
    看官网的描述, 应该是可以的
    Aether
        7
    Aether  
       2019-06-03 14:56:56 +08:00
    应该是异步的问题?可能需要试试 celery。
    bnbdfg
        8
    bnbdfg  
       2019-06-04 14:30:56 +08:00
    这个跟注册验证发送邮箱是一样的,异步的话搭配上 celery flask-maill 可以的
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5704 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 06:08 · PVG 14:08 · LAX 23:08 · JFK 02:08
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.