Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

carriage return in mailto: 1

Status
Not open for further replies.

mthrawn

Programmer
Aug 17, 2000
42
GB
Does anyone know the carraige return character when using a mailto function? Also if anyone has a list of special characters, that would also be appreciated.
 
What about just putting a return in the code?

That works for <textarea>s
 
You must escape the body for it to work

var subject = &quot;Place subject here&quot;;
var body = &quot;Test: \n\n New line here! \n\n And another!&quot;
top.location.href = &quot;mailto:&quot; + &quot;&amp;subject=&quot; + escape(subject) + &quot;&amp;body=&quot; + escape(body);
 
The only way I get it to work is by adding the following to the body var.

var body= &quot;Line 1&quot;+'%0A%0D'+&quot;Line 2&quot;;
 
BobZwick-

50racer is right, but so are you. your soloution just works around using the escape function. for example, the escape function converts the space (' ') character to '%20', I would bet that '%0A%0D' is just the escaped version of the carriage return. Robert Carpenter
questions? comments? thanks? email me!
eclipse_web@hotmail.com
Icq: 124408594
online.dll

AIM & MSN: robacarp
 
%0A is the carriage return, %0D is the line feed. DOS and Windows use the combination of the two to indicate a newline in a text file, Unix uses only the carriage return. Tracy Dryden
tracy@bydisn.com

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard.
 
I have the same problem using with Groupwise as an email service. I have tried '%0A%0D', '\n','\n\n',escape..etc...still no luck. Please help anyone.

Thank you
AB
 
No luck. This is my test page...

<html>
<head>
<title></title>
<script language=&quot;JavaScript&quot;>

function EmailLink(){
var testText

testText= &quot;this is a test&quot; + '\n\r\n\r' + &quot;this is a 2nd line&quot;
window.location = &quot;mailto:&quot;+&quot;?subject=I thought this link might interest you.&quot; + &quot;&body=&quot; + testText;
}
document.write('<INPUT class=&quot;select&quot; TYPE=&quot;button&quot; VALUE=&quot;E-mail this link to a friend&quot; onClick=&quot;EmailLink()&quot;></FORM>')

</script>
<BODY>
</body></html>
 
how bout using %5Cn%5Cr%5Cn%5Cr

these r just guesses - i cant test it right now - im in school right now. i get out in an hour - i have the code to do this at home. I had this same problem a while back. -gerrygerry
Go To
 
ace Scripter,
I tried <br>. I use Outlook Express at home and the code &quot;%0A%0D&quot; works find. But we use Groupwise at work. Whatever I have tried so far is not working.
 
daklao,
try escaping body (and subject as well, just in case..)

Code:
function EmailLink(){
var testText

testText= &quot;this is a test \n\r this is a 2nd line&quot;
var subj=&quot;I thought this link might interest you.&quot;
window.location = &quot;mailto:&quot;+&quot;?subject=&quot; + escape(subj) + &quot;&body=&quot; + escape(testText)
}
document.write('<INPUT class=&quot;select&quot; TYPE=&quot;button&quot; VALUE=&quot;E-mail this link to a friend&quot; onClick=&quot;EmailLink()&quot;></FORM>')

i haven't messed with Groupwise yet,
would this work?

Code:
testText= &quot;this is a test <br> this is a 2nd line&quot;
 
I did try '\n\r',<br> with escape funciton. No luck. The problem is with Groupwise (Novell) is not recognizing it. I may have to find alternative resolution. I don't know what yet. Thank you guys.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top