Edit

GetAllContactEmailsForRole ( nameCode, role [, detailed] )

Result Type: string

Definition:  Gets the contact email addresses from the Name identified by nameCode, for the contact role(s) specified by the role parameter. The result is a comma-delimited list of email addresses. The role parameter can be a numeric bitmask specifying multiple roles, or it can be a string containing a single role name.

Valid role bit values are the powers of 2 from #1 to #8000, and the special values #10000 for Contact1 and #20000 for Contact2. E.g. #10003 gets email addresses (if present) for Contact1 and the first and second named roles (Payables and Receivables, by default)

Valid role names are those from the Document Preferences Fields tab (Contact Roles list)

If you pass "*" for the optional detailed param, the list will be a tab-and-newline-delimited table containing all of the contact fields for the matching contacts, not just the email addresses.