[Javascript] Mailto with blanks in subject

Ken Schaefer ken at adOpenStatic.com
Thu Apr 5 09:12:21 CDT 2001


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
: maybe offf topic but I hope someone has come across this problem.
: I'm running MS IE 5.0 with MS Outlook 97.
:
: <A HREF="mailto:x.y at a.b?subject=Feedback with blanks&body=The InetSDK Site
: Is Superlative">
:
: When I use the above line I don't get the expected results.
: Outlook is started and a new mail is opened but the subject line contains
: only the first word (feedback) which
: is translated to lowercase. The mail body is empty.
: Is this a problem with Outlook or should I change the mailto HREF?

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

I don't know what email client you are using, but you might be able to see
that the link above stops being highlighted after the first space?

Spaces are not allowed in URIs. If the space is in the URL, you need to use
%20 which is the escaped ASCII value for a string literal " ". If the space
is in the value of a parameter in the URL you need to use a +
eg

<a
href="mailto:x.y at a.b?subject=Feedback+with+blanks&body=The+InetSDK+Site+Is+S
uperlative">

<disclaimer>
I'm in Australia, it's about 1 a.m. where I am, and I've had 6 beers so
far...so the above needs to be taken with a stiff drink...or 6 beers. :-)
</disclaimer>

Cheers
Ken





More information about the Javascript mailing list