Open mail program with a filled subject and body does not work correctly

I have the following javascript function that should open (in our case lotus notes) with pre-populated email.

function emailpage() { strTitle = document.title; strTitle = strTitle.replace("&","-"); window.location = "mailto:" + "?subject=I thought this link might interest you." + "&body=" + strTitle + " - " + window.location; } 

but instead I get the following:

enter image description here

+4
source share
1 answer

Replacing the body and item should help you:

 function emailpage() { strTitle = document.title; strTitle = strTitle.replace("&","-"); window.location = "mailto:?body=" + strTitle + " - " + window.location + "&subject=I thought this link might interest you."; } 
+4
source

Source: https://habr.com/ru/post/1492891/


All Articles