推荐学习书目
› 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 · Apr 2, 2015 · 3009 views
    This topic created in 4205 days ago, the information mentioned may be changed or developed.
    直接发送后邮件收到一封邮件,但我用QQ邮件回复到Gmail的时候,Gmail会自动加入到会话里,我直接发送的不会加入到那个会话,请问如何操作?

    加了In-Reply-To 也没有用。
    1 replies  •  2015-04-02 21:39:03 +08:00
    sbmzhcn
        1
    sbmzhcn  
    OP
       Apr 2, 2015
    已搞定,除了添加
    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)

    这样才行。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2814 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 22ms · UTC 08:49 · PVG 16:49 · LAX 01:49 · JFK 04:49
    ♥ Do have faith in what you're doing.