I have created a function to send message via MSMQ but getting exception while executing. below is my function. public …