在python中用指定的replyto编写Thunderbird

2024-10-02 00:23:10 发布

您现在位置:Python中文网/ 问答频道 /正文

我一直在用python为thunderbird编写电子邮件,但似乎无法将回复设置为field。我试过以下几种不同的方法。 我没有得到任何错误与这个方法,它组成只是罚款它只是不会填写“答复”字段

''

def composeEmail():
    import subprocess
    tbirdPath = r'c:\Program Files (x86)\Mozilla Thunderbird\thunderbird.exe'
    to = 'sendto@somewhere.com'
    subject = 'This is my subject'
    mBody = 'This is the contents'
    replyTo = 'replies@somewhere.com'

    body = ('<html><body><h1></h1>%s<br></body></html>' % mBody)
    composeCommand = 'format=html,to={},reply-to={},subject={},body={}' .format(to, replyTo, subject, body)
    subprocess.Popen([tbirdPath, '-compose', composeCommand])
composeEmail()

''


Tags: to方法comishtmlbodythissubject

热门问题