I am trying to add a hyperlink with my email intent using an anchor tag as shown in the image below. I am getting the URL and the description from a REST API. But when I send the email, the link itself is not getting hyperlinked but simply being displayed as plain text.
val emailIntent = Intent(Intent.ACTION_SEND)
emailIntent.flags = Intent.FLAG_ACTIVITY_NEW_TASK
emailIntent.putExtra(Intent.EXTRA_SUBJECT,"Subject of the mail")
emailIntent.type = "text/html"
emailIntent.putExtra(Intent.EXTRA_TEXT,
HtmlCompat.fromHtml(emailDescription, HtmlCompat.FROM_HTML_MODE_LEGACY)
)
...
startActivity(emailIntent)
val emailDescription = """
<p> Dear ${response.userName},<br><br>
Tariffs for your plan has been increased by $10.
To know more visit our website <a href="${respone.websiteUrl}">${response.websiteDesc}</a><br</p>
""".trimIndent()
I wanted the output as shown in this image. But it is reflecting as plain text when the user recieves the mail. Thanks in advance.