PDA

View Full Version : Mailto:Javscript+ASP_blank row


tufanocak
01-08-2003, 09:43 AM
<%@LANGUAGE="VBSCRIPT" >
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=">
</head>
<%
Dim bodytexter,a,b,c,d,e,f
bodytexter="User:"+"blabla"+ Chr(10)
a = "text1V1"
b = "text2V1"
c = "text3V1"
d = "text4V1"
e = "text5V1"
f = "text6V1"

bodytexter=bodytexter + "text:"+a+"text2:"+b+ Chr(10) + Chr(10) +"text3:"+c + "text4:"+d


%>
<body>
<A href="mailto:makrkus@test.com?subject=test&body=<% response.Write(bodytexter) %>"> send email </A>

</body>
</html>

When you click on the 'send e-mail' text your default e-mail program will be open with the subject and with the body text.But i cant write
a blank row between the text2 and text 3. Chr(10) does not work,also i have tried with "+vbCrLf",it dosnt work also.
how can i make a blank row between text2 and text3.
can anybody help ?

khillabolt
01-08-2003, 06:04 PM
You can use the ASCII code of "%0D".

Example:

bodytexter=bodytexter & "text:" & a & "text2:" & b & "%0Dtext3:" & c & "text4:" & d


Notes:
1. I changed all of your "+" to "&" (Proper VBScript concats).
2. The ASCII code is placed inside of the string, not with your variables (right before text3:)...
3. ASCII code chart: http://www.motionnet.com/cgi-bin/search.exe?a=showlink&no=65

HTH,
Kevin

tufanocak
01-09-2003, 07:19 AM
i have tried but it dont work;

This is the result of the code.
i have this string on the body of the mail.
User:blablatext:text1V1text2:text2V1text3:text3V1text4:text4V1
in one line.
i want to make it so:
User:blabla
blablatext:text1V1text2:text2V1
text3:text3V1text4:text4V1

Have we made a mistake on the ASCII code ?

glenngv
01-09-2003, 07:41 AM
http://www.webreference.com/js/column70/3.html

khillabolt
01-09-2003, 02:02 PM
Hmm. It worked for me.

What are you using for an email client? My default is OutlookXP, and it seems to handle the ascii code properly.

khillabolt
01-09-2003, 02:04 PM
Hey glenngv,

I was under the impression that tufanocak was trying to do it server side using active server pages (hence the response.write). I don't think this link is the answer...

glenngv
01-10-2003, 07:06 AM
yes I know that. But using the tool in this link could give him the idea of what ascii code to output by server-side code in place of line breaks.

whammy
01-11-2003, 12:39 AM
tufanocak, if you're trying to format ANY email message, you should never use client-side scripting since it's VERY problematic, and there are javascript bugs that have never been resolved, especially in Outlook Express (and perhaps other email clients, but that is probably the most commonly used).

The only time I use "mailto" is if it's just a plain old "email me" link, with no other information except my email address (and perhaps subject/cc).

Check out:

http://www.aspfaqs.com/aspfaqs/ShowCategory.asp?CatID=10

:)