How to connect button to email through code

I have a repeater connected to my dataset. In this repeater there is a button for each item that I want to connect to the “email” field in the dataset so that when a user clicks on it, the email will automatically open in their email client (like how it works when you connect a button to an email through the built in button settings). This field is set as a text field and I can’t figure out how to connect it through code.