Script: AddRecipients - jobisoft/quicktext GitHub Wiki

Add recipients to the mail. (similar to [HEADER](/jobisoft/quicktext/wiki/to|[email protected])) A type could be specified to add recipients to the to, cc, bcc, reply-to area.

Script (Thunderbird 102 or newer)

let type = this.mVariables[0];
let adresses = this.mVariables[1].split(';');

var win = this.mWindow;

if(type == "to") {
  let toRow = win.document.getElementById("addressRowTo");
  win.addressRowAddRecipientsArray(toRow, adresses, true);
}

if(type == "cc") {
  let ccRow = win.document.getElementById("addressRowCc");
  win.addressRowAddRecipientsArray(ccRow, adresses, true);
}

if(type == "bcc") {
  let bccRow = win.document.getElementById("addressRowBcc");
  win.addressRowAddRecipientsArray(bccRow, adresses, true);
}

if(type == "reply-to") {
  let replyRow = win.document.getElementById("addressRowReply");
  win.addressRowAddRecipientsArray(replyRow, adresses, true);
}

Script (Thunderbird 91 or older)

let type = this.mVariables[0];
let adresses = this.mVariables[1].split(';');

var win = this.mWindow;

if(type == "to") {
  win.awAddRecipientsArray("addr_to", adresses);
}

if(type == "cc") {
  win.awAddRecipientsArray("addr_cc", adresses);
}

if(type == "bcc") {
  win.awAddRecipientsArray("addr_bcc", adresses);
}

if(type == "reply-to") {
  win.awAddRecipientsArray("addr_reply", adresses);
}

Usage

Add recipients to to:

[SCRIPT=AddRecipients](/jobisoft/quicktext/wiki/to|John-Doe-<[email protected]>;Jane-Doe-<[email protected]>;[email protected])

Add recipients to cc, bcc and reply-to:

[SCRIPT=AddRecipients](/jobisoft/quicktext/wiki/cc|John-Doe-<[email protected]>)
[SCRIPT=AddRecipients](/jobisoft/quicktext/wiki/bcc|Jane-Doe-<[email protected]>)
[SCRIPT=AddRecipients](/jobisoft/quicktext/wiki/reply-to|[email protected])