The parameter:
-to_party_id: required
needs to be changed to:
-to_addr: required
and the variable $to_party_id changed accordingly.
R.