0

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.

1

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;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.