Please find the code in jsFiddle. It uses jQuery to modify the href of the link. You can use any other library in its place. It should work.
HTML
<a id="emailLnk" href="#">
<img src="http://ssl.gstatic.com/gb/images/j_e6a6aca6.png">
</a>
JS
$(document).ready(function() {
$("#emailLnk").attr('href',"mailto:[email protected]");
});?
UPDATE
Another code sample, if the id is known only during the click event
$(document).ready(function() {
$("#emailLnk").click(function()
{
window.location.href = "mailto:[email protected]";
});
});?