wp_mail sending mail twice!

Thanks for the comments!

I figured it out. I tried the regular php mail function and still the same thing. Then I decided to make a page template and add only the mail() function, get_header(), and get_footer(). It still sent it out twice. So I opened my header.php and commented the wp_head() function to rule out my functions and any included files in the theme. Still it was sending it twice. So I removed the header all together and it sent the email once.

After narrowing it down it turned out to be the link to favicon. In the theme there is an option to upload a custom favicon. In the header it had the code to echo out the link to favicon but I hadn’t uploaded it yet so it was empty. For some strange reason this was causing my emails to be sent out twice. I’m thinking it had something to do with the headers maybe I’m not sure but I changed the code to only display if it wasn’t empty. Like this:

<?php if(of_get_option( 'favicon' )):?>
  <link href="https://wordpress.stackexchange.com/questions/179849/<?php echo of_get_option("favicon' ); ?>" rel="shortcut icon">
<?php endif; ?>

If you are setting meta data or links in between the head section make sure you include and if like above or you just might drive someone crazy over something so small.