Contact form not sending out email from my website / Using PHP / Ubuntu 13.10 x64

March 31, 2014 7.8k views
I'm currently unable to receive emails from the contact form on my website, I created the form linked to a php file. I'm new to this and at first I didn't know that PHP had to be installed in the server, and when I submitted a filled out test form from the website, the php file opened up. After looking at this issue, I installed php5 on the server, and when I submit the form everything looks to be working ok, it redirects to an html message and secondly to the home page just as it is intended to work. But I don't receive an email after it, I have tried it like 7 times and I just don't know if the email is sent elsewhere, or is just not sending it. I have checked the php file to see if it has the correct address already. My only guess is that something else has to be installed in the server for it work or maybe the server is blocking emails from going out. Please Help
1 comment
4 Answers
First step is to check logs (maybe /var/log/mail.log depending on the distro). Keep it open while you try to send mail via php to try and see what's going on. Also check http://dnsinspect.com to run some tests and make sure something isn't horribly broken.
I did the dnsinspect.com and everything passed the only warning I received was this:

WARNING: Minimum TTL value is 1800. Recommended values [3600 .. 86400] (1 hour ... 1 day). Minimum TTL was redefined in RFC 2308, now it defines the period of time used by slaves to cache negative responses.

The email address where I want to receive the information from the form
is social_media@demipais.com

I checked the mail.log file and I think this appears to be the last two attempts when I tested the form:

Thank you for your help!

Mar 31 14:04:02 localhost postfix/pickup[15510]: 9CD9060BB5: uid=33 from=
Mar 31 14:04:02 localhost postfix/cleanup[15947]: 9CD9060BB5: message-id=<20140331180402.9CD9060BB5@localhost>
Mar 31 14:04:02 localhost postfix/qmgr[15511]: 9CD9060BB5: from=, size=479, nrcpt=1 (queue active)
Mar 31 14:04:02 localhost postfix/local[15949]: 9CD9060BB5: to=, relay=local, delay=0.04, delays=0.03/0/0/0.01, dsn=5.1.1, status=bounced (unknown user: "social_media")
Mar 31 14:04:02 localhost postfix/cleanup[15947]: A2A2C60BB8: message-id=<20140331180402.A2A2C60BB8@localhost>
Mar 31 14:04:02 localhost postfix/qmgr[15511]: A2A2C60BB8: from=<>, size=2166, nrcpt=1 (queue active)
Mar 31 14:04:02 localhost postfix/bounce[15950]: 9CD9060BB5: sender non-delivery notification: A2A2C60BB8
Mar 31 14:04:02 localhost postfix/qmgr[15511]: 9CD9060BB5: removed
Mar 31 14:04:02 localhost postfix/local[15949]: A2A2C60BB8: to=, relay=local, delay=0.01, delays=0/0/0/0, dsn=2.0.0, status=sent (delivered to mailbox)
Mar 31 14:04:02 localhost postfix/qmgr[15511]: A2A2C60BB8: removed

Mar 31 14:05:02 localhost postfix/anvil[15870]: statistics: max connection rate 1/60s for (smtp:72.35.12.183) at Mar 31 14:00:02
Mar 31 14:05:02 localhost postfix/anvil[15870]: statistics: max connection count 1 for (smtp:72.35.12.183) at Mar 31 14:00:02
Mar 31 14:05:02 localhost postfix/anvil[15870]: statistics: max cache size 2 at Mar 31 14:00:41
Attempt to send an email from terminal using the mail command first just to see everything is set up properly. If it doesn't work then you haven't set up your mail server properly, in which case reply back with your configurations on http://pastebin.com, if it works then it's most likely an application error.

Alternatively you can use some kind of mail sending thing like mandrill.

Did you set up SMTP and IMAP for mail? The server can not send out email if it has no email services

Have another answer? Share your knowledge.