Subject in email

Brooke's picture

She has: 681 posts

Joined: Feb 1999

Hello everyone,

How do you code your site so that when you click an email link the subject has somethng in it? It's just a one liner - but I can't remember how to do it.

TIA!

Brooke

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

http://www.google.com/search?hl=en&q=email+subject&btnG=Google+Search

http://www.codebrain.com/javascript/emailsubjectandcopyto/ in case you don't want to look at the options, but I recommend you do, because there are some issues with this.

It doesn't work in Opera, and I think one of the Netscapes.

Smiling Suzanne

Mark Hensler's picture

He has: 4,048 posts

Joined: Aug 2000

<a href="mailto:[email protected]?subject=your_subject">Email Bob</a>
'I have a bit more complicated one at maxalbert.com. Just click my name at the bottom. Wink

Mark Hensler
If there is no answer on Google, then there is no question.

Mark Hensler's picture

He has: 4,048 posts

Joined: Aug 2000

A note... I like to URL encode my links. You can use this to URL encode your strings.

<html>
<body>

&lt;script language=javascript&gt;
<!--
function Encode() {
    document.forms.URLencode.encoded.value = escape(document.forms.URLencode.original.value);
}
function Decode() {
    document.forms.URLdecode.decoded.value = unescape(document.forms.URLdecode.original.value);
}
//-->
&lt;/script&gt;

<form name=URLencode onSubmit="Encode(); return false;">
original:<BR>
<textarea name="original" rows="5" cols="50"></textarea><BR>
encoded:<BR>
<textarea name="encoded" rows="5" cols="50"></textarea><BR>
<input type=button value="Encode It!" onClick="Encode()">
</form>

<form name=URLdecode onSubmit="Decode(); return false;">
original:<BR>
<textarea name="original" rows="5" cols="50"></textarea><BR>
decoded:<BR>
<textarea name="decoded" rows="5" cols="50"></textarea><BR>
<input type=button value="Encode It!" onClick="Decode()">
</form>
</body>
</html>
'I've tested it in IE 6, NN 4.77, NN 6.2.

Mark Hensler
If there is no answer on Google, then there is no question.

Brooke's picture

She has: 681 posts

Joined: Feb 1999

Thank you all for your help! I went through all of that information!

Brooke

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.