This is a notice, not a fatal error. the line if(!$mime) is returning the notice. Change it to if(!isset($mime)) and the error will be suppressed:
<p>Email Address: <?php echo $user->user_email; ?></p>
<?php if ( !isset($mine) ) : ?>
<?php if ( !in_array($user_id, $friends) ) : ?>