To begin with, the MX record is part of the entries in the domain’s DNS zone, and therefore part of the domain’s configuration. If we look at the domain settings as a tree, then DNS servers are its root, while the DNS zone and entries are branches, where each has its own purpose and assigned a role.
MX records are responsible for indicating where the e-mail boxes of a given domain will be handled, and more specifically if the sender sends a message to e.g. a mailbox [email protected] which you have, then in the first step there will be a question whether such a domain exists, in the next step where the DNS servers are located and based on them the third step will appear, i.e. querying MX records in order to, so that the server of the sender of the message knows exactly where to deliver the message.
It is worth mentioning that mail does not necessarily have to be handled by the same service provider and on the same server where the website is located and operates.
To use the e-mail mailboxes created in mybox.com and for messages to be delivered correctly to those mailboxes, the domain’s DNS zone should contain the following entries:
mx-1.mybox.com mx-2.mybox.com