Put this JavaScript in the <head> of your html page:
Code: Select all
<script type="text/javascript">
function contact(domain,user) {
window.location.href = "mailto:" + user + "@" + domain;
}
</script>
Code: Select all
<a href="javascript:contact('example.com','name');">Contact Us</a>
Code: Select all
<script type="text/javascript">
function contact(user) {
window.location.href = "mailto:" + user + "@example.com";
}
</script>
<a href="javascript:contact('name');">Contact Us</a>
Code: Select all
window.location.href = "mailto:" + user + "@" + domain + "?subject=This is the subject line&body=This is some body text";