WordPress.org

Ready to get started?Download WordPress

Forums

Contact Form 7 error (19 posts)

  1. naskogashi
    Member
    Posted 5 years ago #

    Hello there!

    1st of all I would like to thank the developer of Contact Form 7 for its simplicity. I've installed it in my server, but If someone tries to send me through the form That I've created they will get this error "Failed to send your message. Please try later or contact administrator by other way.".

    I have reinstalled the plugin and all, its active and all, but I cant fix the problem.

    Any suggestions? thanks for any help!

    http://wordpress.org/extend/plugins/contact-form-7/

  2. Takayuki Miyoshi
    Member
    Posted 5 years ago #

    naskogashi,

    What color of border do you see? Red one?

  3. naskogashi
    Member
    Posted 5 years ago #

    Yeap a red bloodilicous one :)

  4. Takayuki Miyoshi
    Member
    Posted 5 years ago #

    Red border means wp_mail() function really failed. Do you receive other mails from WordPress such as comment notifications?

  5. naskogashi
    Member
    Posted 5 years ago #

    Thanks alot for your time takayukister. Well let me say that in my previous host the script worked perfectly.

    Since Ive moved to yahoo hosting, the notifications didnt work until Ive installed the wordpress through their tools.

    I suspect that yahoo has its own settings to wp_mail(). Yeah I do get notofications for every comment, pings, message, forgot password and so on.

    So is there anything left for me to do?

  6. Takayuki Miyoshi
    Member
    Posted 5 years ago #

    naskogashi, try to use the same sender address as other notifications, I mean, wordpress@<your-domain> or like that. Yahoo might filter mails based on sender address.

  7. naskogashi
    Member
    Posted 5 years ago #

    I just did! Its not helping! Same error :(

  8. Takayuki Miyoshi
    Member
    Posted 5 years ago #

    mmm, curious. Is it possible to see the source code of WordPress on the Yahoo hosting? I'm wondering if wp-includes/pluggable.php is the same one as original. Or are there special plugins made by Yahoo working???

  9. naskogashi
    Member
    Posted 5 years ago #

    Here is the my pluggable.php from my wordpress in yahoo:
    http://nasko.biz/etc/pluggable.rar
    ........................................................

    Well as I've understood all the plugins work expet those that have to do with wp_mail().

    Here is the adress to Contact Form 7 plugin in my site:
    http://nasko.biz/web/?page_id=41

    Thanks again for your time!

  10. punctuatingreality
    Member
    Posted 5 years ago #

    I'm having this same issue, on a self-hosted WordPress site - schumachertileandstone.com. Was there a fix found?

    Thanks!

  11. kinow
    Member
    Posted 5 years ago #

    Ossu minna sama!

    I dunno if we're experiencing the same issue... I know only that I couldn't send mails using Contact Form 7, with a newly wordpress 2.7 installation. My PHP version is 5.2.4, and my server has a sendmail installed in /usr/sbin/sendmail. Just a common web server (Apache) with PHP installed.

    I tried, after some googleing, use wp-mail-smtp plugin. But my Yahoo! account seems have problems to let PHP use it as main account to send mails through SMTP (instead of the mail php function + local sendmail). After that, I tried again using Contact Form and wp_mail function. Which, by the way, was using now mail() PHP function to send the mail. Just as you guys should be trying to do now.

    After some time thinking about the problems in directly editing the Contact Form 7 Plugin in WordPress Theme Editor, I changed two lines of code and it worked. Seems to be some problem with the headers that the plugin uses when sending mails.

    //(...)
                }
                //return @wp_mail($mail_recipient, $mail_subject, $mail_body, $mail_headers, $for_this_mail);
                return @wp_mail($mail_recipient, $mail_subject, $mail_body);
            } else {
                //return @wp_mail($mail_recipient, $mail_subject, $mail_body, $mail_headers);
                return @wp_mail($mail_recipient, $mail_subject, $mail_body);
            }
            // (...)

    Actually, I thought about it after seeing wp-mail-smtp plugin testing the mail function. In the plugin code, they used the php mail function this way (TO, SUBJECT, BODY) and it worked... while wp_mail function sending the mail_headers parameter was broken.

    Maybe Contact Form 7 guys can check what's wrong with the plugin and the header stuff.

    Cheers!!! Yoroshiku!!! ( ^ u ^)v

  12. Takayuki Miyoshi
    Member
    Posted 5 years ago #

    Hi kinow, do you mean this wp-mail-smtp plugin?

    http://wordpress.org/extend/plugins/wp-mail-smtp/

    I'll take a look at it.

    By the way, if you change the code like this, does it still fail to send?

    }
        //return @wp_mail($mail_recipient, $mail_subject, $mail_body, $mail_headers, $for_this_mail);
        return @wp_mail($mail_recipient, $mail_subject, $mail_body, 'YOUR NAME <your-mail-address@your-host>');
    } else {
        //return @wp_mail($mail_recipient, $mail_subject, $mail_body, $mail_headers);
        return @wp_mail($mail_recipient, $mail_subject, $mail_body, 'YOUR NAME <your-mail-address@your-host>');
    }

    (change the <your-mail-address@your-host> to your right address)

  13. Takayuki Miyoshi
    Member
    Posted 5 years ago #

    Sorry, my last code is incorrect. The correct one is below:

    }
        //return @wp_mail($mail_recipient, $mail_subject, $mail_body, $mail_headers, $for_this_mail);
        return @wp_mail($mail_recipient, $mail_subject, $mail_body, 'From: YOUR NAME <your-mail-address@your-host>');
    } else {
        //return @wp_mail($mail_recipient, $mail_subject, $mail_body, $mail_headers);
        return @wp_mail($mail_recipient, $mail_subject, $mail_body, 'From: YOUR NAME <your-mail-address@your-host>');
    }
  14. Jim Goodrich
    Member
    Posted 5 years ago #

    I have been experiencing the same issue only the site is hosted on BlueHost. I tried modifying wp-contact-form-7.php first using takayukister's code in the message directly above this, no change.

    I then deleted the code per Kinow's post and it worked for the site. Great fix, thank you.

  15. florida-internet-marketing
    Member
    Posted 4 years ago #

    Thank you for the fix, I also found out that if you change the name of the form, it will still show up, but not send. So if you have the same form on a few pages and change the name, make sure to change it everywhere else

  16. softtaco
    Member
    Posted 4 years ago #

    Thanks for the fix but there is still a problem regarding with the results. I did modify Contact Form 7 straight from the WordPress Plugin Editor using Kinow's code.

    I tried to send a test Email but I can only see the "Subject" and the "Message Body" in my inbox as what i entered in the contact form. My problem is, I want to know why the "Name" stays as my website name and the "Email" stays as the email I did set for my wp-mail-smtp plugin EVENTHOU i entered a different Name and Email at those text areas....

  17. srujun01
    Member
    Posted 4 years ago #

    Hello,
    I want to know where exactly have I got to modify the code as per kinow's example?
    Also, under Tools >> Contact Form 7, what have I got to do in the "Mail" section? As I am new to WordPress, I have very little idea of what to do edit or what not to edit in plugins.

  18. neochilds
    Member
    Posted 4 years ago #

    The slight correction to the code that kinow posted works for yahoo hosting note the difference between the comment and the actually code.
    The comment is the original code for those not sure what the comment is that would be the part in bold with "//"
    }
    //return @wp_mail($mail_recipient, $mail_subject, $mail_body, $mail_headers, $for_this_mail);
    return @wp_mail($mail_recipient, $mail_subject, $mail_body);
    } else {
    //return @wp_mail($mail_recipient, $mail_subject, $mail_body, $mail_headers);
    return @wp_mail($mail_recipient, $mail_subject, $mail_body);
    }
    :::::::::::

  19. Dezmodious
    Member
    Posted 4 years ago #

    I'm running into the same error. I cannot seem to get any of my forms to work. Upon clicking send, I receive "Failed to send your message. Please try later or contact administrator by other way." in a red bound box.
    What file are you editing with the above code. I looked in wp-contact-form-7.php to give it a try but couldn't find the code you were referencing.

Topic Closed

This topic has been closed to new replies.

About this Topic