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
sbmzhcn
V2EX  ›  Python

Python 下的 smtp 发送邮件,直接发送与回复的关系?

  •  
  •   sbmzhcn · 2015-04-02 20:03:30 +08:00 · 2429 次点击
    这是一个创建于 3331 天前的主题,其中的信息可能已经有所发展或是发生改变。
    直接发送后邮件收到一封邮件,但我用QQ邮件回复到Gmail的时候,Gmail会自动加入到会话里,我直接发送的不会加入到那个会话,请问如何操作?

    加了In-Reply-To 也没有用。
    1 条回复    2015-04-02 21:39:03 +08:00
    sbmzhcn
        1
    sbmzhcn  
    OP
       2015-04-02 21:39:03 +08:00
    已搞定,除了添加
    body.add_header('In-Reply-To', email_object.message_id)
    body.add_header('References', email_object.message_id)

    body.add_header('Message-ID', email.utils.make_msgid())

    之外,标题必须是
    body['Subject'] = "Re: {0}".format(email_object.subject)

    这样才行。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   1039 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 21:34 · PVG 05:34 · LAX 14:34 · JFK 17:34
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.