Contact Form 7 – Not Sending E-mail

So I recently just installed Contact Form 7 WordPress plugin to handle any contacts that I may receive. Installation and setup was easy. But then. I wasn’t receiving any of the test e-mails I sent myself.
Note: You should always test core functionality whenever you make a change.
So I dug in, nothing in the PHP error log. Nothing in the HTTP error log. Finally, I did this:

[[email protected] public_html]# find -name error_log
[[email protected] public_html]# find /var/log -mmin -2
/var/log/httpd/access_log
/var/log/maillog
[[email protected] public_html]# tail -f /var/log/maillog
Aug  3 21:40:45 mat sendmail[10624]: s742ejx0010624: from=apache, size=577, class=0, nrcpts=1, msgid=<[email protected]>, [email protected]
Aug  3 21:40:45 mat sendmail[10624]: s742ejx0010624: [email protected], ctladdr=apache (48/48), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30577, relay=[127.0.0.1] [127.0.0.1], dsn=4.0.0, stat=Deferred: Connection refused by [127.0.0.1]
Aug  4 13:47:38 mat sendmail[12028]: s74IlcBK012028: from=apache, size=658, class=0, nrcpts=1, msgid=<[email protected]>, [email protected]
Aug  4 13:47:38 mat sendmail[12028]: s74IlcBK012028: [email protected], ctladdr=apache (48/48), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30658, relay=[127.0.0.1] [127.0.0.1], dsn=4.0.0, stat=Deferred: Connection refused by [127.0.0.1]
Aug  4 13:54:54 mat sendmail[12070]: s74IssjP012070: from=apache, size=590, class=0, nrcpts=1, msgid=<[email protected]>, [email protected]
Aug  4 13:54:54 mat sendmail[12070]: s74IssjP012070: [email protected], ctladdr=apache (48/48), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30590, relay=[127.0.0.1] [127.0.0.1], dsn=4.0.0, stat=Deferred: Connection refused by [127.0.0.1]
Aug  4 14:03:19 mat sendmail[12195]: s74J3JaF012195: from=apache, size=633, class=0, nrcpts=1, msgid=<[email protected]>, relay=apac[email protected]
Aug  4 14:03:19 mat sendmail[12195]: s74J3JaF012195: [email protected], ctladdr=apache (48/48), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30633, relay=[127.0.0.1] [127.0.0.1], dsn=4.0.0, stat=Deferred: Connection refused by [127.0.0.1]
^C
[[email protected] public_html]# date
Mon Aug  4 14:04:40 CDT 2014
[[email protected] public_html]# mail -v [email protected]
Subject: Test
Hello world
.
EOT
[email protected] Connecting to [127.0.0.1] via relay...
[email protected] Deferred: Connection refused by [127.0.0.1]

So I found my problem, there was something wrong with sendmail connecting to the server. Turns out sendmail wasn’t running or even configured to start. So I went ahead and setup chkconfig for sendmail and restarted the service. And again as always tested to ensure the I could send mail – not only via CLI but also through the Contact Form plugin.

[[email protected] public_html]# chkconfig --levels 235 sendmail on
[[email protected] public_html]# service sendmail restart
Shutting down sendmail:                                    [FAILED]
Starting sendmail:                                         [  OK  ]
Starting sm-client:                                        [  OK  ]
[[email protected] public_html]# mail -v [email protected]
Subject: OMG TEST
testing
.
EOT
[email protected] Connecting to [127.0.0.1] via relay...
220 mat.mattharris.org ESMTP Sendmail 8.14.4/8.14.4; Mon, 4 Aug 2014 14:07:03 -0500
>>> EHLO mat.mattharris.org
250-mat.mattharris.org Hello localhost [127.0.0.1], pleased to meet you
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-8BITMIME
250-SIZE
250-DSN
250-ETRN
250-DELIVERBY
250 HELP
>>> MAIL From:<[email protected]> SIZE=223
250 2.1.0 <[email protected]>... Sender ok
>>> RCPT To:<[email protected]>
>>> DATA
250 2.1.5 <[email protected]>... Recipient ok
354 Enter mail, end with "." on a line by itself
>>> .
250 2.0.0 s74J73Ki012276 Message accepted for delivery
[email protected] Sent (s74J73Ki012276 Message accepted for delivery)
Closing connection to [127.0.0.1]
>>> QUIT
221 2.0.0 mat.mattharris.org closing connection

Write a Comment

Your email address will not be published. Required fields are marked *