Open an email program with subject and body prefilled is not working correct

匆匆过客 提交于 2019-12-10 16:20:52

问题


I have the following javascript function which should open (in our case lotus notes), with a prefilled 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 am getting this:


回答1:


Replacing body and subject 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.";
}


来源:https://stackoverflow.com/questions/17804554/open-an-email-program-with-subject-and-body-prefilled-is-not-working-correct

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!