How to encode correclty an url with the char "&" for an email?

In a plugin I need to send an email to confirm a member registration. Inside this email HTML Content, there is a link with two parameters like this :

site_url() . "/user-profile/?activate=truetoken=" . $token

My problem is the char "" which prevent to send the email.

I tested the function esc_url() without success.

What is the WP solution ?

Topic html-email urls Wordpress encoding

Category Web

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.