I am on a dedicated server however our server was misconfigured to receive mail so anything that it sent by the phpmailer is being sent to the server which doesnt have a mail client.
Our DNS is also hosted by the webhost and that is configured to send the mail to the right spot.
However our sendmail function only wants to send to localhost.
Most likely, you are using Postfix (correct?) and has been configured to send mail to "x.com" locally. Look at the "transport_maps" option in the configuration.