Failed to send your message Contact Form 7

I was working on a WordPress blog recently and building a custom contact form using one of my favorite form builder plugins, Contact Form 7 when I encountered the following error every time I went to submit the form. The error was “Failed to send your message. Please try later or contact the administrator by another method”. It was enclosed in a RED box. Well, since I was the administrator I really couldn’t call him or her now could I?

I’ll admit, this one puzzled me for a little while. I have maintained other blogs and never had a problem with Contact Form 7. After searching the Internet I found this was a common problem that many folks have run into. The most common fix was to make sure that the FROM: address matches the domain of your blog site. If your blog website site is xyz.com, then the FROM: address should be something@xyz.com. However, that did not work for me. I had to also make sure that the To: address matched the domain of my blog. That worked!

Example of Contact Form 7 configuration (Bad)

Example of Contact Form 7 configuration (Good)

If you’ve tried the steps above and got your Contact Form to work, then you’re good to go. If you want to know how I troubleshot the problem, keep reading. I used a really nice WordPress plugin called WP Mail SMTP. I’m not using this plugin to send email but I did use it to “test” the sending of my contact form.

I used WP Mail SMTP to send a test email to my Gmail account. This was the original email I had set up in the To: field in my Contact Form.

When I pressed Send Test, I received the SMTP log below. If you scroll all the way down to the bottom, you’ll noticed the errors that prevented the Contact Form 7 from sending the form successfully.

The SMTP debugging output is shown below:
CLIENT -> SMTP: MAIL FROM:
SMTP -> get_lines(): $data was “”SMTP -> get_lines(): $str is “250 OK Sender ok
“SMTP -> get_lines(): $data is “250 OK Sender ok
“SMTP -> FROM SERVER:250 OK Sender ok
CLIENT -> SMTP: RCPT TO:
SMTP -> get_lines(): $data was “”SMTP -> get_lines(): $str is “550 No such user here
“SMTP -> get_lines(): $data is “550 No such user here
“SMTP -> FROM SERVER:550 No such user here
SMTP -> ERROR: RCPT TO command failed: 550 No such user here

I noticed that my issue had nothing to do with the FROM: address but instead, it was receiving and 550 – No such user error for the RCPT To: address (highlighted above).

So, I changed the To: address to send to an email address in the same domain as my From: address and did Send Test.


Now notice the SMTP log below after scrolling to the bottom, you’ll see the test was successful.

The SMTP debugging output is shown below:
CLIENT -> SMTP: To: contact@georgealmeida.com
CLIENT -> SMTP: From: wordpress@georgealmeida.com
CLIENT -> SMTP: Subject: WP Mail SMTP: Test mail to contact@georgealmeida.com
CLIENT -> SMTP: Message-ID: <4cbeeab24280fd41e88aab82138b7d1c@gccgl.com>
CLIENT -> SMTP: X-Priority: 3
CLIENT -> SMTP: X-Mailer: PHPMailer 5.2.7 (https://github.com/PHPMailer/PHPMailer/)
CLIENT -> SMTP: MIME-Version: 1.0
CLIENT -> SMTP: Content-Type: text/plain; charset=UTF-8
CLIENT -> SMTP: Content-Transfer-Encoding: 8bit
CLIENT -> SMTP:
CLIENT -> SMTP: This is a test email generated by the WP Mail SMTP WordPress plugin.
CLIENT -> SMTP:
CLIENT -> SMTP:
SMTP -> get_lines(): $data was “”SMTP -> get_lines(): $str is “250 OK
“SMTP -> get_lines(): $data is “250 OK
“SMTP -> FROM SERVER:250 OK
CLIENT -> SMTP: QUIT

George Almeida

Welcome to my little corner of the blogosphere. I'm an Information Technology Director. I specialize in Windows operating systems, applications, servers, storage, networks and also have a technical background on the IBM iSeries platform. My only purpose for this blog is the hope that it helps someone, someday, somewhere. Any meager proceeds derived from our sponsors will be donated to charity.

You may also like...

Subscribe
Notify of
guest

This site uses Akismet to reduce spam. Learn how your comment data is processed.

2 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Sylvia Lobo
8 years ago

Hi I tried using Contact Form and get “Failed to send your message. Please try later or contact the administrator by another method.” error. But when i send email through the WP MAil it works fine and I am getting emails.I also tried to check if php mail() was working by creating this test script –

and it works fine on the server. I have Wordpres 4.4.2 installed on IIS 8.5..Please help

2
0
Would love your thoughts, please comment.x
()
x