You can use:
strpos — Find the position of the first occurrence of a substring in a string.
<a href="<?php echo strpos($this->field('contact_person_mail#'.$elementCount)->value(),"http") !== false ? "" : "mailto:";
echo $this->field('contact_person_mail#'.$elementCount)->value(); ?>
">
Since, you haven't mention the name of that variable I am assuming that contact_person_mail could contain both URL or email.
UPDATE:
In case of ternary operator returns FALSE you don't need to echo anything. since your URL or email is already getting echoed after that. Ternary operator is only of printing mailto:.