Html::email with image

Good morning.

Is it possible to use the Html::email method with a image instead of text?
My link look like this, but doesn’t work:

<?= Html::email('info@ddd.ch?subject=Anfrage von ddd.ch', '<img src="assets/images/icon_mail.svg">') ?>

If you want to use an image instead of a string, you have to create your mailto link manually. You would have to make sure to add alternative text to your image to make it accessible. However, I think that some text with a claim to get in touch would make a lot more sense than a mail icon.

Thanks for your input! Icon or text is more a design relevant question. In my case a icon would be a better match, but i get your point. I want a encoded email link, so manually is not a option. Or is encoding also possible with the manually solution?

Yes, using Str::encode()

Thanks! It works.