I want to add a user/login to role in another database without switching databases I have a role / login in a 'new' database mynewdb with a role "emailsender". I have scripted a profile for sp_send_dbmail and am now trying to script adding the the login to the DatabaseMailUserRole in msdb and seem to be going around in circles. Importantly I want to run my update script in mynewdb. I know I can use SSMS to do this. The question is:

How to script adding the user to the role in T-SQL from the mynewdb database without switching to msdb?
EXEC msdb.sys.sp_executesql N'ALTER ROLE ...';