Change default WordPress header in mail

There is a bug in in contact form 7 plugin, it happens when you use PIPES ( | ) to change the recipient address, so doing this you can fix it, if you dont understand me, take a look at : contactform7.com/selectable-recipient-with-pipes

The code is pretty simple, you just have to know what a wordpress filter is!

function site_mail_from_name ($mail_from_name) {
  $site_mail_from_name = 'YOUR_WEB_SITE_NAME';
  if(empty($site_mail_from_name)) {
    return $mail_from_name;
  }
  else {
    return $site_mail_from_name;
  }
}

add_filter('wp_mail_from_name','site_mail_from_name',1);

Obviously change “YOUR_WEB_SITE_NAME” by your website name…., and this should be inside your functions.php!