PHP mail() function not working

We just switched over to a new dedicated server with GoDaddy. FTPed all my files over from the GoDaddy Shared Hosting acct to the new Dedicated Server. The email forms that use the mail() function do not work on this server. It is a fresh/new configuration, and unlike the shared hosting acct, this server was NOT setup and ready to go. In the PLESK interface, I fond that this LINUX server uses (QMAIL) for SMTP and the service is running. However my test forms are not arriving, even though on submit, they do take you to the Thank You page with NO ERRORS. Is there some kind of switch I need to turn on, or some setting I need to tweak???

Below is the code of the test email form:

Here are the logs from /var/log/messages:
Nov  5 14:13:49 hostname xinetd[13652]: START: smtp pid=23712 from=xx.xx.xx.xx (<------ Our IP addr)
Nov  5 14:13:49 hostname xinetd[13652]: EXIT: smtp status=0 pid=23712 duration=0(sec)
<?php mail("user@domain.com", "test message from godaddy", "this is a test message, if you are reading this the email was sent successfully."); ?>

Open in new window

LVL 8
pzozulkaAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Mahdii7Commented:
I'm not sure what to say, but for troubleshooting purposes, try this via ssh:

cat /usr/local/psa/var/log/maillog  // (post relevant entries after executing script if applicable)
cat /var/www/vhosts/domain.com/statistics/logs/error_log  // (see if PHP is recording errors with the mail() function here)

I hope you figure it out, I've moved scripts around servers several times and never had this problem. I know things like this can be a pain. Good luck.
0
pzozulkaAuthor Commented:
Below is cat /usr/local/psa/var/log/maillog
Nov  5 14:58:51 hostname qmail-queue-handlers[22151]: Handlers Filter before-queue for qmail started ...
Nov  5 14:58:51 hostname qmail-queue-handlers[22151]: from=anonymous@hostname.ip.secureserver.net
Nov  5 14:58:51 hostname qmail-queue-handlers[22151]: to=tim@domain.com
Nov  5 14:58:51 hostname qmail-queue-handlers[22151]: to=pat@domain.com
Nov  5 14:58:51 hostname qmail-queue-handlers[22151]: to=mason@domain.com
Nov  5 14:58:51 hostname qmail-queue-handlers[22151]: to=alex@domain.com
Nov  5 14:58:51 hostname qmail-queue-handlers[22151]: hook_dir = '/var/qmail//handlers/before-queue'
Nov  5 14:58:51 hostname qmail-queue-handlers[22151]: recipient[3] = 'tim@domain.com'
Nov  5 14:58:51 hostname qmail-queue-handlers[22151]: handlers dir = '/var/qmail//handlers/before-queue/recipient/tim@domain.com'
Nov  5 14:58:51 hostname qmail-queue-handlers[22151]: recipient[4] = 'pat@domain.com'
Nov  5 14:58:51 hostname qmail-queue-handlers[22151]: handlers dir = '/var/qmail//handlers/before-queue/recipient/pat@domain.com'
Nov  5 14:58:51 hostname qmail-queue-handlers[22151]: recipient[5] = 'mason@domain.com'
Nov  5 14:58:51 hostname qmail-queue-handlers[22151]: handlers dir = '/var/qmail//handlers/before-queue/recipient/mason@domain.com'
Nov  5 14:58:51 hostname qmail-queue-handlers[22151]: recipient[6] = 'alex@domain.com'
Nov  5 14:58:51 hostname qmail-queue-handlers[22151]: handlers dir = '/var/qmail//handlers/before-queue/recipient/alex@domain.com'
Nov  5 14:58:51 hostname qmail-queue-handlers[22151]: starter: submitter[22153] exited normally
Nov  5 14:58:51 hostname qmail: 1225922331.231570 new msg 882114
Nov  5 14:58:51 hostname qmail: 1225922331.231635 info msg 882114: bytes 2671 from <anonymous@hostname.ip.secureserver.net> qp 22153 uid 48
Nov  5 14:58:51 hostname qmail: 1225922331.237346 starting delivery 37: msg 882114 to local 1-tim@domain.com
Nov  5 14:58:51 hostname qmail: 1225922331.237432 status: local 1/10 remote 0/20
Nov  5 14:58:51 hostname qmail: 1225922331.237469 starting delivery 38: msg 882114 to local 1-pat@domain.com
Nov  5 14:58:51 hostname qmail: 1225922331.237506 status: local 2/10 remote 0/20
Nov  5 14:58:51 hostname qmail: 1225922331.237542 starting delivery 39: msg 882114 to local 1-mason@domain.com
Nov  5 14:58:51 hostname qmail: 1225922331.237574 status: local 3/10 remote 0/20
Nov  5 14:58:51 hostname qmail: 1225922331.237676 starting delivery 40: msg 882114 to local 1-alex@domain.com
Nov  5 14:58:51 hostname qmail: 1225922331.237715 status: local 4/10 remote 0/20
Nov  5 14:58:51 hostname qmail-local-handlers[22154]: Handlers Filter before-local for qmail started ...
Nov  5 14:58:51 hostname qmail-local-handlers[22156]: Handlers Filter before-local for qmail started ...
Nov  5 14:58:51 hostname qmail-local-handlers[22157]: Handlers Filter before-local for qmail started ...
Nov  5 14:58:51 hostname qmail-local-handlers[22155]: Handlers Filter before-local for qmail started ...
Nov  5 14:58:51 hostname qmail-local-handlers[22157]: from=anonymous@hostname.ip.secureserver.net
Nov  5 14:58:51 hostname qmail-local-handlers[22156]: from=anonymous@hostname.ip.secureserver.net
Nov  5 14:58:51 hostname qmail-local-handlers[22157]: to=alex@domain.com
Nov  5 14:58:51 hostname qmail-local-handlers[22156]: to=mason@domain.com
Nov  5 14:58:51 hostname qmail-local-handlers[22155]: from=anonymous@hostname.ip.secureserver.net
Nov  5 14:58:51 hostname qmail-local-handlers[22155]: to=pat@domain.com
Nov  5 14:58:51 hostname qmail-local-handlers[22154]: from=anonymous@hostname.ip.secureserver.net
Nov  5 14:58:51 hostname qmail-local-handlers[22154]: to=tim@domain.com
Nov  5 14:58:51 hostname qmail-local-handlers[22155]: cannot reinject message to 'pat@domain.com'
Nov  5 14:58:51 hostname qmail-local-handlers[22154]: cannot reinject message to 'tim@domain.com'
Nov  5 14:58:51 hostname qmail: 1225922331.323792 delivery 38: failure: This_address_no_longer_accepts_mail./
Nov  5 14:58:51 hostname qmail-local-handlers[22156]: cannot reinject message to 'mason@domain.com'
Nov  5 14:58:51 hostname qmail: 1225922331.324095 status: local 3/10 remote 0/20
Nov  5 14:58:51 hostname qmail: 1225922331.324854 delivery 37: failure: This_address_no_longer_accepts_mail./
Nov  5 14:58:51 hostname qmail: 1225922331.324895 status: local 2/10 remote 0/20
Nov  5 14:58:51 hostname qmail: 1225922331.324993 delivery 39: failure: This_address_no_longer_accepts_mail./
Nov  5 14:58:51 hostname qmail: 1225922331.325034 status: local 1/10 remote 0/20
Nov  5 14:58:51 hostname qmail-local-handlers[22157]: cannot reinject message to 'alex@domain.com'
Nov  5 14:58:51 hostname qmail: 1225922331.325850 delivery 40: failure: This_address_no_longer_accepts_mail./
Nov  5 14:58:51 hostname qmail: 1225922331.325917 status: local 0/10 remote 0/20
Nov  5 14:58:51 hostname qmail-queue-handlers[22166]: Handlers Filter before-queue for qmail started ...
Nov  5 14:58:51 hostname qmail-queue-handlers[22166]: from=
Nov  5 14:58:51 hostname qmail-queue-handlers[22166]: to=anonymous@hostname.ip.secureserver.net
Nov  5 14:58:51 hostname qmail-queue-handlers[22166]: hook_dir = '/var/qmail//handlers/before-queue'
Nov  5 14:58:51 hostname qmail-queue-handlers[22166]: recipient[3] = 'anonymous@hostname.ip.secureserver.net'
Nov  5 14:58:51 hostname qmail-queue-handlers[22166]: handlers dir = '/var/qmail//handlers/before-queue/recipient/anonymous@hostname.ip.secureserver.net'
Nov  5 14:58:51 hostname qmail-queue-handlers[22166]: starter: submitter[22167] exited normally
Nov  5 14:58:51 hostname qmail: 1225922331.362288 bounce msg 882114 qp 22166
Nov  5 14:58:51 hostname qmail: 1225922331.362347 end msg 882114
Nov  5 14:58:51 hostname qmail: 1225922331.362785 new msg 882120
Nov  5 14:58:51 hostname qmail: 1225922331.362834 info msg 882120: bytes 3472 from <> qp 22167 uid 2522
Nov  5 14:58:51 hostname qmail: 1225922331.375478 starting delivery 41: msg 882120 to remote anonymous@hostname.ip.secureserver.net
Nov  5 14:58:51 hostname qmail: 1225922331.375544 status: local 0/10 remote 1/20
Nov  5 14:58:51 hostname qmail-remote-handlers[22169]: Handlers Filter before-remote for qmail started ...
Nov  5 14:58:51 hostname qmail-remote-handlers[22169]: from=
Nov  5 14:58:51 hostname qmail-remote-handlers[22169]: to=anonymous@hostname.ip.secureserver.net
Nov  5 14:58:52 hostname qmail: 1225922332.051188 delivery 41: success: 64.202.189.86_accepted_message./Remote_host_said:_250_Accepted_message_qp_25707_bytes_3661/
Nov  5 14:58:52 hostname qmail: 1225922332.051279 status: local 0/10 remote 0/20
Nov  5 14:58:52 hostname qmail: 1225922332.051315 end msg 882120
Nov  5 14:58:52 hostname relaylock: /var/qmail/bin/relaylock: mail from 64.202.189.102:43740 (k2smtpout06-01.prod.mesa1.secureserver.net)
[root@hostname sbin]#

Open in new window

0
pzozulkaAuthor Commented:
cat /var/www/vhosts/domain.com/statistics/logs/error_log  did not find any errors pertaining to mail().
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

pzozulkaAuthor Commented:
I moved scripts around as well, but only to shared linux servers that were already setup. This time, its a dedicated server which needs to be setup. I did the initial configuration, and the website is now working, but I feel like im missing something.
0
Mahdii7Commented:
I'm no Linux guru, but from the looks of it this doesn't seem like a PHP problem at all. You are sending remote mail fine. Are you meaning to send to "tim", "pat", "mason", and "alex" locally?

Qmail is definitely trying to send it locally. If you set up a test script that points to an email address using a domain NOT on the server (gmail, yahoo, etc) and it connects, then you'll know there is a configuration problem with your local inboxes.

That's all I can offer, hopefully it gives some ideas.
0
pzozulkaAuthor Commented:
It worked, I emailed a test script to my msn.com account and it worked. So would you by any chance know how to make it not locally for my domain that is on the server. Tim, Pat, Mason, and Alex are not local mailboxes on GoDaddy, so I dont know why its trying to send it locally. Any ideas how to make it not local since the mailboxes are not local?
0
Mahdii7Commented:
In plesk, navigate to your domain, select "Mail" (under services), and "Switch Off" the mail service.

This should force it to send remotely.

Cheers
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Mahdii7Commented:
I forgot to mention, if you are using an external DNS service to manage your DNS records - it may help to turn off the DNS settings in plesk as well. If you rely on plesk for DNS info, you'll need to update the MX records to fit with the godaddy accounts.
0
pzozulkaAuthor Commented:
Thanks for sticking with me. It worked! We do indeed host our DNS records elsewhere so I disabled the DNS records, but what really fixed it I think, is disabling the Mail. Thanks a lot for your help.
0
pzozulkaAuthor Commented:
Thanks for sticking with me. I am unfamiliar with PLESK, but disabling the mail did the trick.
0
Mahdii7Commented:
No problem m8, glad I could help :)
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Email Servers

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.