Email Masking in widget

Try antispambot():

<a href="https://wordpress.stackexchange.com/questions/228312/mailto:<?= antispambot("myemail.examlple.com') ?>">
    <?= antispambot('my email') ?>
</a>

tech