Hello Stone,
Yes, you can implement above requirement using the C#.
Just like all other records, Mailbox entity also have GUID associated with it. So you need the GUID then perform the operation using the C# code.
Please refer below snippets which will help you to implement this requirement.
There is a Tool which is already available in the xrmtool box named as “Mailbox Manager” You can use that.
https://www.xrmtoolbox.com/plugins/Jfm.XrmToolBox.MailboxManager/
Thank You,
Amit Katariya