Link to home
Start Free TrialLog in
Avatar of jmestep
jmestep

asked on

Line feed in text email using content of asp text box

I'm trying to send the content from an asp:TextBox multi line  to a text email via the mailto: function. (Client needs to edit the email before sending- that's why I'm using mailto:)
The text shows up OK in the Textbox on the web form when I use "\r\n". There is a javascript function that pulls the content from that box and adds it to an email and when the email pops up, the linefeeds and even the spaces are removed. How can I keep that from happening. Client doesn't want an html email. Here is the javacript function (code I found somewhere)
  function checkForm() {
        var emailContentText = document.getElementById("<%=VendorContentText.ClientID %>").value;
            var c1 = "mailto:orders@xxx.com?&subject='NewOrders'&body=Note: " + emailContentText + "%0D%0A";
            (window.location ? window.location.replace(c1) : document.write(c1))
    }
If I copy the text from the text box into Notepad++, it shows the spaces and linefeeds.
Thanks

ASKER CERTIFIED SOLUTION
Avatar of uk44
uk44

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jmestep
jmestep

ASKER

Wonderful!
Thanks