I have the following mailto link on an ASP.NET MVC 5 application:
<a rel="nofollow" href="@(
String.Format("mailto:?subject={0}&body={1}",
"The title", "The description" + "%0D%0A" + "http://theurl.xyz")">
share by email
</a>
This is not validating on HTML Validator. I get the error:
Bad value mailto:?subject=The subject&body=This is the url:%0D%0Ahttp://localhost:8580/home for attribute href on element a: Whitespace in query component. Use %20 in place of spaces.
I tried encoding using HttpUtility.UrlEncode
but when I open the email I get "+" signs and others in the subject and body and I am not able to solve that.
HttpUtility.UrlPathEncode
as I've suggested? – Arly