Use this tool to convert your email address into pure HTML codes. Currently the mail harvesters are ignoring this type of email address but the browsers have no problems.
To add a subject to an email add ?subject=wassup to the end of the email address. If the subject needs a space add it as %20 in the email address and a space in the label.
Now, that code is pretty ugly to have littered through your code so if you have a dynamic page, ie PHP, ASP or Perl you can store the email addresses in variables and then call them when you need them.
Throughout your site you give contact details of the person or department responsible for the area being discussed. If the email changes then you want to be able to update that info in a single place, even more imporant when the email is hard to read.
So I'd have a script called funcs.php which is included into every page and in there I'd have this function:
<?php
function getEmail1($name)
{
$names = array();
$names['sales'] = "<a href='mailto:sales@mysite.com'>sales@mysite.com</a>";
$names['returns'] = "<a href='mailto:returns@mysite.com'>returns@mysite.com</a>";
$names['support'] = "<a href='mailto:support@mysite.com'>support@mysite.com</a>";
if (isset($names[$name])) $email = $names[$name];
else $email = $names['sales']; //the default
return $email;
}
?>
So now as I create my website I can just pop in a
echo getEmail1('sales');
as I go and the correct email will be passed back. If it's for an email I haven't yet generated then the sales email will be given.
Now, if you have the ability to add functions in your code then getEmail could well look like this instead:
<?php
function getEmail2($name)
{
$name .= '@mysite.com';
$email = getOrdString('mailto:'.$name);
$label = getOrdString($name);
return "<a href='{$email}'>{$label}</a>";
}
function getOrdString($string)
{
for($i=0;$i<strlen($string);$i++)
{
$bit = $string[$i];
$output .= '&#'.ord($bit).';';
}
return $output;
}//function getOrdString($string)
?>
So now as I create my website I can just pop in a
echo getEmail2('sales');
and the email addresses will be dynamically generated.