When i use encodeURIComponent to encode the body as shown below, and if the body has spaces in it, the resulting link is broken and appears as follows :
http://www.sample.com/sample/explore?itemId=123&type=sample&name=name with space
body = "http://www.sample.com/sample/explore?itemId=123&type=sample&name=name with space"
var newLink = "mailto:?subject=" + encodeURIComponent(subject) + "&body=" + encodeURIComponent(body);
window.location = newLin
How can i fix it and create a valid url?
console.log shows the encoded url correctly but in outlook the link is broken. It should appear as a proper hyperlink