Support » Fixing WordPress » [Plugin: wp mail from] Breaks Contact Form 7

  • Everything works fine, except I’ve just realised that “WP Mail From” has broken “Contact Form 7” in that in “Contact Form 7” it is changing the From: field to that set by WP Mail From.

    But, I should probably add a caveat here in that WP Mail From is doing exactly as it should do, and that it is most likely “Contact Form 7” that may require to be changed. I suspect “WP Mail From” is using a priority of 1, and that all that needs to be done to fix it is that “Contact Form 7” should use a higher priority.

    But, how do I convince the “Contact Form 7” plugin developer to change his plugin to use the priority system?
    Will he argue that his plugin is not doing what it should be doing in the first place?

    That’s the only reason I have left a comment here, as I need help in convincing the Contact Form 7 developer to change his plugin.

    Make sense?



Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi,

    That is exactly right concerning wp-mailfrom using priority 1.

    Funnily enough, the author of Contact Form 7 is not showing much interest in changing their code to use the add_filter() and priorities.

    Because wp-mailfrom uses a higher priority (than whatever default is set by Contact Form 7), it breaks the use of Contact Form 7.

    The CF7 plugin developer doesn’t seem to think he needs to change his plugin to make another plugin work. (He doesn’t see it as ‘his’ plugin isn’t as ‘plugin friendly’ as it could be).

    I just have to work out how to word my request without offending him.

    I had the exact same problem, so I made a small change to WP Mail From to allow contact form 7 to work correctly with it. My change means that if an email goes through WP Mail From with the default wordpress name and address, then WP Mail From changes that name/address to the ones specified in the settings. If however the name/address isn’t the default (like when someone uses the contact form), they are passed straight through. I think this is more sensible behaviour anyway for WP Mail From.

    Here is the snippet of code I changed in the last two functions in wp-mailfrom/wp-mailfrom.php:

    function site_mail_from ($mail_from_email) {
      $site_mail_from_email = get_option('site_mail_from_email');
      if( $mail_from_email != "" || empty($site_mail_from_email) ) {
        return $mail_from_email;
      else {
        return $site_mail_from_email;
    function site_mail_from_name ($mail_from_name) {
      $site_mail_from_name = get_option('site_mail_from_name');
      if( $mail_from_name != "WordPress" || empty($site_mail_from_name) ) {
        return $mail_from_name;
      else {
        return $site_mail_from_name;

    You will have to replace my website name ( with your own in the above code snippet – or indeed spend five minutes making it work generically.

    Anyway, works for me, hope it helps someone else.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Plugin: wp mail from] Breaks Contact Form 7’ is closed to new replies.