problem with this code

wxdqz

New Member
I can use the following code to make it so that if someone selects an option from the menu, it will automatically generate an email message filling in the subject, To: field, and part of the body.
My problem is that while I can add more info to the body of the message, I have not been able to figure out how to put carriage returns into the body of the email message using this method. I need to be able to do this so that I can have multiple lines of data being submitted into the email messag.
Currently the "var body = new Date()" line includes todays date in the email body.
I will be using the "body" variable to add additional information to the body of the message.

Any help is greatly appreciated.

function email()
{
var subject = document.forms[0].reason.options[document.forms[0].reason.selectedIndex].value
var varTL = document.forms[0].TLname.options[document.forms[0].TLname.selectedIndex].value

var body = new Date()

if (subject != "" && varTL != "")
{
location.replace("MAILTO:[email protected]?cc= " + varTL + "&subject= " + subject + "&body=" + body);

return true;
}
else
{
alert("You must enter a phone # or a monkey will shoot you!.")
}

}
</script>
 
Back
Top