I am working on a website where the contact form is not sending emails to any address. I checked the wp_mail function using this github code: https://gist.github.com/butlerblog/5c9b805529c419b81447 It shows that the wp_mail function is working - but no emails! I decided to take a peek at the DNS and MX records using leafdns. They gave cpanel access, but they're not using Cpanel webmail. I have never seen a setup like this, where a host would use different servers for mail and http. Can someone provide some insight here?
Have you checked the server-logs for any issues? Apache/PHP-logs? If there's an issue with the actual sendmail-function, or something, it should be in the logs.
I would use an SMTP plugin to send mail, as the phpmail function (which I believe the wp_mail function is piggy backing on) will send email as the owner/user, and if this is not a valid email address (which is very likely is not) it will be rejected. Are you receiving any bounce back messages? Regards, Chris
I only see 2 errors in the logs, and they are very strange. [Mon Mar 14 10:49:02.268397 2016] [core:error] [pid 22457] (36)File name too long: [client 93.113.125.12:44444] AH00036: access to /we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages failed (filesystem path '/home/generalmi/public_html/we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages') [Sat Mar 12 22:59:07.443923 2016] [core:error] [pid 31053] (36)File name too long: [client 137.226.113.7:37086] AH00036: access to /YesThisIsAReallyLongRequestURLbutWeAreDoingItOnPurposeWeAreScanningForResearchPurposePleaseHaveALookAtTheUserAgentTHXYesThisIsAReallyLongRequestURLbutWeAreDoingItOnPurposeWeAreScanningForResearchPurposePleaseHaveALookAtTheUserAgentTHXYesThisIsAReallyLongRequestURLbutWeAreDoingItOnPurposeWeAreScanningForResearchPurposePleaseHaveALookAtTheUserAgentTHXYesThisIsAReallyLongRequestURLbutWeAreDoingItOnPurposeWeAreScanningForResearchPurposePleaseHaveALookAtTheUserAgentTHXYesThisIsAReallyLongRequestURLbutWeAreDoingItOnPurposeWeAreScanningForResearchPurposePleaseHaveALookAtTheUserAgentTHXYesThisIsAReallyLongRequestURLbutWeAreDoingItOnPurposeWeAreScanningForResearchPurposePleaseHaveALookAtTheUserAgentTHXYesThisIsAReallyLongRequestURLbutWeAreDoingItOnPurposeWeAreScanningForResearchPurposePleaseHaveALookAtTheUserAgentTHXYesThisIsAReallyLongRequestURLbutWeAreDoingItOnPurposeWeAreScanningForResearchPurposePleaseHaveALookAtTheUserAgentTHXYesThisIsAReallyLongRequestURLbutWeAreDoingItOnPurposeWeAreScann failed (filesystem path '/home/generalmi/public_html/YesThisIsAReallyLongRequestURLbutWeAreDoingItOnPurposeWeAreScanningForResearchPurposePleaseHaveALookAtTheUserAgentTHXYesThisIsAReallyLongRequestURLbutWeAreDoingItOnPurposeWeAreScanningForResearchPurposePleaseHaveALookAtTheUserAgentTHXYesThisIsAReallyLongRequestURLbutWeAreDoingItOnPurposeWeAreScanningForResearchPurposePleaseHaveALookAtTheUserAgentTHXYesThisIsAReallyLongRequestURLbutWeAreDoingItOnPurposeWeAreScanningForResearchPurposePleaseHaveALookAtTheUserAgentTHXYesThisIsAReallyLongRequestURLbutWeAreDoingItOnPurposeWeAreScanningForResearchPurposePleaseHaveALookAtTheUserAgentTHXYesThisIsAReallyLongRequestURLbutWeAreDoingItOnPurposeWeAreScanningForResearchPurposePleaseHaveALookAtTheUserAgentTHXYesThisIsAReallyLongRequestURLbutWeAreDoingItOnPurposeWeAreScanningForResearchPurposePleaseHaveALookAtTheUserAgentTHXYesThisIsAReallyLongRequestURLbutWeAreDoingItOnPurposeWeAreScanningForResearchPurposePleaseHaveALookAtTheUserAgentTHXYesThisIsAReallyLongRequestURLbutWeAreDoingItOnPurposeWeAreScann') Code (markup): I am not receiving any bounce back messages.
One more thing, I can't even access the default webmail via domain.com/webmail or the IP address:2095 I get a "this site can't be reached" error.
Just tried sending via SendGrid API, still won't work! There has to be something going on here. SMTP, Default Wp_mail, SendGrid API - nothing works.
I activated the postman plugin and now I am seeing some errors in the log: [22-Apr-2016 04:49:36 UTC] ERROR PostmanWpMail: Exception code=0 message=Could not open socket [22-Apr-2016 05:00:42 UTC] ERROR PostmanWpMail: Exception code=451 message=Temporary local problem - please try later [22-Apr-2016 05:05:34 UTC] ERROR PostmanWpMail: Guzzle\Http\Exception\CurlException code=0 message=[curl] 6: Couldn't resolve host 'api.sendgrid.com' [url] https://api.sendgrid.com/api/mail.send.json [22-Apr-2016 05:06:06 UTC] ERROR PostmanWpMail: Guzzle\Http\Exception\CurlException code=0 message=[curl] 6: Couldn't resolve host 'api.sendgrid.com' [url] https://api.sendgrid.com/api/mail.send.json [22-Apr-2016 05:11:37 UTC] ERROR PostmanWpMail: Guzzle\Http\Exception\CurlException code=0 message=[curl] 6: Couldn't resolve host 'api.sendgrid.com' [url] https://api.sendgrid.com/api/mail.send.json Code (markup):
The fileNameTooLong errors are some sort of overflow error attempt, I think (as long as those IP-addresses are outside your range), and the last error seems to fail on reaching the sendgrid API - blocked by the hosting provider? Or some issues with their DNS server?