Sending mail via PHP isn't working, the MX records point elsewhere
Is your email hosted elsewhere, for example with Microsoft 365 or Google Workspace, and do your MX records point there? Then you also need to uncheck a box in DirectAdmin. Otherwise our server thinks it should deliver the mail itself. Mail from your website (for example a contact form) to your own domain will then not arrive, with a message like 550 Requested action not taken: mailbox unavailable or not local.
- Log in to DirectAdmin: in My WebOké, go to My Products and click DirectAdmin next to your hosting package.
- Under E-Mail Manager, click MX Records.
- Under Options, uncheck Use this server to handle my e-mails.
- Click Save.
You can also do this in My WebOké: go to My Domains, tab DNS, and in the Email settings card, under Quick setup, choose Microsoft 365 or Google Workspace. This also sets the MX and SPF records and turns off Delivery on our server for that domain. See Quickly setting up email in the DNS.
See also: MX records: where does your email come in? in the DirectAdmin manual.
Detailed explanation with screenshots: Email with Microsoft 365 or Google Workspace, website with WebOké in the DirectAdmin manual.
Want to learn more? Take the free WordPress course, lesson 9.1 Email from WordPress.
