When someone elects to E-mail you it is possible to have any of the e-mail fields pre-filled.
<A href="mailto:yourname@youraddress?cc=yourname2@youraddress2">Mail Me</A>
<A href="mailto:yourname@youraddress?bcc=yourname3@youraddress3">Mail Me</A>
For multiple "cc" and "bcc" addresses separate them with a semi colon ";"
<a href="mailto:yourname@youraddress.com?subject=Your Subject">Mail Me</a>
<a href="mailto:yourname@youraddress.com?Body=Your Opening Message Here">Mail Me </A>
To format to your message the following values are the equivelent to a carriage return and line feed.
<A href="mailto:yourname@youraddress.com?Body=If you put a message in the body of your E-Mail%0D%0AYou can have more than one line of text.%0D%0A%0D%0AThis is just some more boring text for this example.%0D%0A%0D%0AAnd a bit more for this bit as well.">View Example</A>
You can have any combination of fields pre-filled but the first field after the mailto address must be preceded by the question mark with the other fields preceded by the ampersand.
<A href="mailto:yourname@youraddress?cc=yourname2@youraddress2&bcc=yourname3@youraddress3&subject=Your Subject&body=Your message here.">Mail Me</A>
Note: The above is all one line with no spaces.
The scripts below allows your visitor to e-mail the address of the page that they are viewing to a friend.
The first example is a simple text link, when clicked a prompt box appears for entering the email address of the recipient.
<script type="text/javascript">
<!--
function Mailit() {
var address=prompt("Please enter your friends E-mail address");
if (address){
document.location.href=("mailto:" + address +" ?subject=A web page to see&body=I found this web page at " + document.location.href + ", which I thought you might like to see.")
}
}
// -->
</script>
<a href="javascript:Mailit()">Recommend this page</a>
The second script allows for a more prominent display.
<script type="text/javascript">
<!--
function Mailit(form) {
document.location.href=("mailto:" + form.address.value + "?subject=A web page to see&body=I found this web page at " + document.location.href + ", which I thought you might like to see.")
return false
}
//-->
</script>
<FORM name="Recom" onsubmit="return Mailit(Recom)">
<TABLE>
<TR><TD>Recommend this Web page to a friend</TD></TR>
<TR><TD><INPUT type="text" name="address" size="35" value="Enter Email Address">
<INPUT type="button" name="Button" onclick="Mailit(this.form)" value="Send"></TD></TR>
</TABLE>
</FORM>
Example address: youraddress@yourplace.co.uk
The following: (all one line)
youraddress@yo
urplace.co.uk
spells out:
youraddress@yourplace.co.uk
So your complete e-mail line would be:
<a href="mailTo:youraddress@
yourplace.co.uk">
Your E-Mail</a>
Click Here To Open Sample Mail
It does look a bit extreme but you only have to create the line once then you can cut & Paste wherever it is needed.
For more information on "Keycodes" see Which Key in my Javascript section and Characters in my general C section