E-mail

See also Contact List, Recommend, and Anti-spam

When someone elects to E-mail you it is possible to have any of the e-mail fields pre-filled.

View CC field pre-filled

<A href="mailto:yourname@youraddress?cc=yourname2@youraddress2">Mail Me</A>

View BCC field pre-filled

<A href="mailto:yourname@youraddress?bcc=yourname3@youraddress3">Mail Me</A>

For multiple "cc" and "bcc" addresses separate them with a semi colon ";"

View Subject field Pre-filled

<a href="mailto:yourname@youraddress.com?subject=Your Subject">Mail Me</a>

View Body Field Text

<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.

%0D%0A where 0 = zero. This allows for mulitple lines of text. View Example

<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.

View All Fields Pre-filled

<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.


Recommend

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.

Recommend this page

<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.

Recommend this Web page to a friend

<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>


Anti Spam

If the spam merchants spiders cannot read your e-mail address then they cannot spam you.
It all depends on how determined the spammers are as to whether the follow tips will suffice.

Example address: youraddress@yourplace.co.uk

  1. One way is to include an additional letter in the address

    yyouraddress@yourplace.co.uk
A footnote informing people that the first y must be deleted has to be shown.
  1. Put your address as decimal code. (Not sure if spiders can read decimal)

The following: (all one line)

&#121&#111&#117&#114&#97&#100&#100&#114&#101&#115&#115&#64&#121&#111
&#117&#114&#112&#108&#97&#99&#101&#46&#99&#111&#46&#117&#107

spells out:

youraddress@yourplace.co.uk

So your complete e-mail line would be:

<a href="mailTo:&#121&#111&#117&#114&#97&#100&#100&#114&#101&#115&#115&#64
&#121&#111&#117&#114&#112&#108&#97&#99&#101&#46&#99&#111&#46&#117&#107">
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