user4611642
user4611642

Reputation: 27

compose Thunderbird with specified reply-to in python

I've been composing emails in python for thunderbird but I can't seem to set the reply-to field. I've tried the following with a few variations. I don't get any errors with this method, it composes just fine it just won't fill in the "reply-to" field.

'''

def composeEmail():
    import subprocess
    tbirdPath = r'c:\Program Files (x86)\Mozilla Thunderbird\thunderbird.exe'
    to = '[email protected]'
    subject = 'This is my subject'
    mBody = 'This is the contents'
    replyTo = '[email protected]'

    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()

'''

Upvotes: 1

Views: 356

Answers (1)

Tim P
Tim P

Reputation: 437

Unfortunately, this is not possible. You may want to file a bug here. Only these parameters are available at the moment:

https://hg.mozilla.org/comm-central/file/tip/mailnews/compose/src/nsMsgComposeService.cpp#l1356

Upvotes: 1

Related Questions