Just recomendation of my own thoughts:
I'd leave the email's "unformated", and add the mailto tags when needed later (outputting the info to a page for example). It makes it easier to use the database later when gathering information.
As I dont know your problem, more than its wrong, I have no answer... Try:
$output = '<a href="mailto:'.$email.'"></a>';