I have found the following info:
I have managed to create a working version:Watch out for the somewhat complex syntax of the "-compose" command-line option. The double-quotes enclose the full comma-separated list of arguments passed to "-compose", whereas single quotes are used to group items for the same argument. Example:
thunderbird -compose "to='john@example.com,kathy@example.com',cc='britney@example.com',subject='dinner',body='How about dinner tonight?',attachment='C:\temp\info.doc,C:\temp\food.doc'"
Code: Select all
import webbrowser, os
from urllib.parse import quote
body = """Some text,
Bla bla bla. Text."""
recipient = 'address1@mail.com'
cc = 'address2@mail.com,address3@mail.com'
subject = 'Title of the mail'
attatchment = 'C:\ABC\\DE\\FGH\\IJK.pdf'
os.system("thunderbird -compose to=" + recipient +",cc= 'address2@mail.com,address3@mail.com' ,subject=" + quote(subject) + ",body=" + quote(body) + ",attachment=" + attatchment +"\"")
However, if I substitute 'address2@mail.com,address3@mail.com' for cc variable (which contains those two cc email addresses):
Code: Select all
os.system("thunderbird -compose to=" + recipient + ",cc=" + cc + ",subject=" + quote(subject) + ",body=" + quote(body) + ",attachment=" + attatchment + "\"")
Any idea how to fix that?