functions to perform a 'sendmessage', but using classes and actions.