Question

I am trying to add body to an email that i sending through JavaScript. I have a SharePoint list view when clicked on sends an email to EmailID.

This works fine,

var mail="mailto:"+emailID+"?Subject=Test:"+ctx.CurrentItem.ID

I am trying to add body of the email. I have tried

var mail="mailto:"+emailID+"?Subject=Test:"+ctx.CurrentItem.ID&body=Test

and

var mail="mailto:"+emailID+"?Subject=Test:"+ctx.CurrentItem.ID;body=Test. 

Nothing worked.

Can anyone please suggest.

Was it helpful?

Solution

Looks like an issue with double quotes.

Try it as below:

var mail= "mailto:" + emailID + "?Subject=Test: " + ctx.CurrentItem.ID + "&body=Some body text";

If you want a dynamic body text, try it as below:

var bodyText= "some body text";
var mail= "mailto:" + emailID + "?Subject=Test: " + ctx.CurrentItem.ID + "&body=" + bodyText;
Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top