Click to See Complete Forum and Search --> : problem with this code


geuis
04-08-2003, 12:14 PM
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:monkey@monkeyslikeguns.com?cc= " + varTL + "&subject= " + subject + "&body=" + body);

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

}
</script>

Nevermore
04-08-2003, 12:28 PM
I believe it is \n

geuis
04-08-2003, 12:42 PM
Tried both body = \n + "blah blah blah" and body = "\n" + "blah blah blah" but neither versions worked.

geuis
04-08-2003, 02:01 PM
I realized I had mistakenly made a similar post like this last week. What Dave Clark said was that mailto does not support email formatting.
Is there an alternative method beside <form post="mailto:email@email.com"> or the code I did above to get IE to auto create a new mail message from the default client?