PHP邮件不会发送到我自己的域名?

I'm sending a simple mail message like so

mail("info@mydomain.com","foo","bar");

The mail is successfully sent and received everywhere, but not if I send it to an email that is set on my own domain.

I redirected the mail to Outlook.com and opened a few accounts there, and they will not receive any messages sent from my site.

The first issue that I can think of is some sort of a loopback problem, but I have no idea how to solve this issue.. I'm on a shared hosting so I don't have too much access either..

Any input might help, Thanks

I've had this problem myself in a site.

There was an issue with the way our system was set up, so that the system thought that because the email was coming from the same domain it was a spam email and as such blocked it.

Check with your system administrator that you are allowed to be sending the emails etc.

Either that, or you'll have to modify the headers to have look like it's being sent from an external address. Hope you get it sorted.