Problems with Contact Form 7 for Wordpress not working properly
After installing Wordpress, I immediately started customizing with content and plugins. One particular plugin I installed was the Contact Form 7 Plugin
After installing and configuring, I realized the plugin would give an error message: “Failed to send your message. Please try later or contact administrator by other way.” After digging around, I realized the Contact Form 7 plugin uses the PHP mail() function, which by default uses sendmail to send email. On my server, I had not installed sendmail yet. So after installing that… no more error message.
Now, after clicking send and waiting a REALLY LONG time, the form said “Your message was sent successfully. Thanks”. This was a hopeful message. However, when checking my inbox… no new messages.
After digging further, I noticed “DSN: Service unavailable” error messages in my /var/log/mail.log file, as well as complaints about my hostname being unqualified:
Oct 12 00:49:44 lamp sm-mta[3230]: My unqualified host name (lamp) unknown; sleeping for retry
Oct 12 00:49:46 lamp sm-msp-queue[3235]: My unqualified host name (lamp) unknown; sleeping for retry
So when using sendmail to send email messages, it’s best if the hostname of the machine is a FQDN. So I changed my hostname to the FQDN of my server
# sudo hostname www.matthardy.info
and restarted the sendmail service
# sudo /etc/init.d/sendmail restart
Now, sendmail works properly, and the form instantly and successfully sends the email message to my mail server!
Hope that helps some others of you out there having issues.
-Matt
Thanks for this, however, as a complete novice i have to say i don’t understand a word of it! Is there anyway you can describe this issue in short words for a complete idiot?
Which part do you need help with? Do you have wordpress installed on your own server, or do you have it hosted somewhere?
Thanks for this tutorial. It couldn’t have come at a better time.
Do you have any experience with Media Temple DV accounts or Plesk 8? Would love to know if you have a quick solution. If not, I’ll just ping their KB.
Thanks!
Awesome, thanks for sharing.
Hi, I´ve recently installed Contact 7 and seem to be having the similar series of problems you encountered. Could you please explain in further detail how to change my hostname to the FQDN of my server.
Thanks.