Tuesday, February 26, 2013

Send email with line break in body

Sending email using java script from SharePoint can be tricky sometimes. Using built-in SharePoint function 'escapeproperly' can be usefull here.

function SendEmail() 

{
  var data = "FIRST LINE" + "\n" + "SECOND LINE" + "\n" + "THIRD LINE";
  window.location = 'mailto:?body='+ escapeProperly(data);
}

</script>


No comments: