4 Replies Latest reply on Mar 5, 2014 6:59 AM by MadMich

    Line breaks not working as expected

    MadMich Level 1

      Hi All,


      This is driving me nuts!

      I have a button that sends xml data via email (using entourage for testing) with some information about it.

      The line from example below 'var cBody = "Project:" + ProjectNo +  "\n" + "Thank you for submitting your form."; should read in the body of the email like so:


      Project: 123456

      Thank you for submitting your form


      No matter what i tried (\r, \p, <br>) i get  one line like so:

      Project:XXXXX-XXX Thank you for submitting your form.

      Can anyone see where i am going wrong?

      The example is in it's context below:-


      // This is the form return e-mail. Its hardcoded

      // so that the form is always returned to the same address

      // Change address on your form

      var cToAddr = "me@mycompany.com";

      // First, get the client CC e-mail address

      var cCCAddr = this.getField("ClientEmail").value;

      // Now get the beneficiary e-mail only if it is filled out

      var cBenAddr = this.getField("my_Email").value;


      var ProjectNo = this.getField("ProjectNo").value;


      if(cBenAddr != "") cCCAddr += ";" + cBenAddr;

      // Set the subject and body text for the e-mail message

      var cSubLine = " new data";

      var cBody = "Project:" + ProjectNo +  "\n" + "Thank you for submitting your form.";

      //** Send the form data as an XML attachment on an e-mail



      // Build the e-mail URL

      var cEmailURL = "mailto:mywebsite.com?cc=" + cCCAddr + "&subject=" + cSubLine + "&body=" + cBody;


                cURL: cEmailURL,