/*
Configure the variables and case options
*/
$domain = "mycompany.com";
switch ($to) {
case "info":
$addr_info = "MyCompany, Inc.";
break;
case "webmaster":
$addr_info = "To the Webmaster";
break;
case "name":
$addr_info = "Surname I. Name";
break;
/*
and add as many case options as you want here.
*/
default:
$addr_info = "mailto.php configuration error";
$to = "webmaster";
}
/* send the mail header */
header ("Location: mailto:$addr_info <$to@$domain>");
?>
-- END file otliam.php --
Save this as 'otliam.php' or anything else.
In your page, instead of using
<a href="mailto:name@mycompany.com">Send a email to: Surname I. Name</a>
which can be spidered by any email spam robot include the following link to your
page (example):
<a href="otliam.php?to=name">Send a email to: Surname I. Name</a>