From MozillaZine Knowledge Base
Thunderbird supports the following command line arguments:
- The -profile "path" command line argument to specify the location of the profile. It's used to run Thunderbird with the specified profile regardless of whether the Profile Manager knows about that profile's existence. It's described in more detail in the writeup on USB drive support but it does not require a USB drive. Its useful if you're a roaming user or Thunderbird somehow lost track of your profile (perhaps due to your system crashing) and you want to verify the profile is still good before trying to fix the problem. Example: "C:\Program Files\Mozilla Thunderbird\thunderbird.exe" -profile e:\my_profile will launch Thunderbird with the profile stored at e:\my_profile. A quick sanity check is that e:\my_profile should contain your prefs.js file. Note however that you normally cannot start Thunderbird with a second profile if Thunderbird is already running.
- The -migration command line argument opens import wizard which help with import data from Outlook (Express) and Mozilla Suite/SeaMonkey.
- The path of a .eml file. This will launch Thunderbird with a window displaying the contents of the .eml file. For example, "C:\Program Files\Thunderbird\thunderbird.exe" c:\test.eml
Compose new mail with command line
You have to use the command line "-compose" to launch Thunderbird and open a new compose window.
The following arguments are available:
- "to" : used to specify the email of the recipient
- "cc" : used to specify the email of the recipient of a copy of the mail
- "bcc" : used to specify the email of the recipient of a blind copy of the mail*
- "newsgroups" : one or more news groups to submit the message to*
- "subject" : subject of the mail
- "format" : compose the message in HTML ("format=1") or plain text ("format=2")*
- "preselectid" : an identifier for the "From" identity to choose from the menu*
- note that you cannot directly specify an e-mail address but need to find the identity key
- for example, "preselectid=id2" would select the identity #2
- you can find the key by try-and-error or by searching for useremail in the Config Editor
- "body" : body of the mail
- "attachment' : specify the directory and the name of an attachment
- the value should be a file:// url, properly encoded
- with tb3+, you can alternatively use the absolute file name (unencoded)
*(in Thunderbird 3.1.9 and earlier, these options must be preceded by at least one other option and cannot be at the start of the argument list due to bug 627999.)
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 "firstname.lastname@example.org,email@example.com',firstname.lastname@example.org',subject='dinner',body='How about dinner tonight?',attachment='C:\temp\info.doc,C:\temp\food.doc'"
- (use attachment="file:///C:/temp/food.doc" for Thunderbird 2.0)
For mailto: urls the "in-reply-to" header is also supported
- "in-reply-to" : adds In-Reply-To with the provided reference, adds it to References