You need to listen for the click event on <a>
tags with a "mailto:" link. Assuming you're using jQuery, here is the code:
$('a[href^="mailto:"]').on('click', function(e){
var email = $(this).attr('href').replace('mailto:', '');
// submit action to server here.
});
Update: make sure this code is running after the DOM ready event, like so:
jQuery(function($){
$('a[href^="mailto:"]').on('click', function(e){
var email = $(this).attr('href').replace('mailto:', '');
// submit action to server here.
});
});