Forum Moderators: open

Message Too Old, No Replies

Ampersand in mailto link

What a headache!

         

Krapulator

6:48 am on Oct 31, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



No matter what I do, I cannot place an ampersand in the subject line of a mailto link (as part of the subject line).

Ive tried using the character entities and it still cuts off at the point that Ive inserted the ampersand entity.

Why why why?

dingman

6:53 am on Oct 31, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Browsers sometimes see that as a get-method mail submission URL. It's kinda weird, but if you happen to hit on variable names the browser knows, it will stick them in the message it brings up for the user. The only on I know to work is 'subject'. Otherwise they seem to get ossed out, in my limmited fiddling with this idea. It didn't look very useful, so my curiosity waned quickly.

Reflect

12:51 pm on Oct 31, 2002 (gmt 0)

10+ Year Member



Hi

Here is an overview of mailto: syntax. I broke the link just in case of TOS...

www.ietf.org/rfc/rfc2368.txt

Brian

Krapulator

10:12 pm on Oct 31, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hmm interesting. Th RFC says that & should work. In Outlook 2K it treats the & as an actual ampersand.

Perhaps a bug in outlook?

emailtools

11:00 pm on Oct 31, 2002 (gmt 0)

10+ Year Member



The "&" is used to specify a command, so your email
programme is expecting one. If there is no subsequent
command, your mail programme will ignore the "&".

mailto:joe@example.com?subject=mysubject&body=hello

If you want "and" in the subject line, you'll need
to spell it. For a phrase, words can be separated by
an underscore (these appear in the subject line too):

mailto:joe@example.com?subject=Jack_and_Jill&body=hello

Note: "&" is only needed when the mailto link is in an
HTML mail.

Krapulator

11:19 pm on Oct 31, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Yeah I understand that. My main problem is that the company I work for has an ampersand in the Company Name (Which I really wanted to use in the subject line if the mailto link.)

choster

11:35 pm on Oct 31, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Have you tried using %26? A mailto is a url, after all.

mailto:joe@example.com?subject=Jack%26Jill

Or with spaces on either side,

mailto:joe@example.com?subject=Jack%20%26%20Jill