link

<?php
function encode_mailto($mail, $label, $subject = "", $body = "") {
$chars = preg_split("//", $mail, -1, PREG_SPLIT_NO_EMPTY);
$new_mail = "<a href="mailto:";
foreach ($chars as $val) {
$new_mail .= "&#".ord($val).";";
}
$new_mail .= ($subject != "" && $body != "") ? "?subject=".$subject."&body=".$body : "";
$new_mail .= "">".$label."</a>";
return $new_mail;
}
?>

source

Leave a Reply