Emails can be sent from practically any where, this can be servers, email service providers such as Google Mail and Microsoft Outlook or can be sent from malicious spam bots.
It is important that emails are "verified" as being sent from a legitimate source, this can cause problems when sending emails from a server such as Magento as the server will not be known as legitimate unless the domain has been configured to register it as such.
Use SMTP to an email provider¶
This is the preferred approach as it offloads the responsibility of sending emails to a provider (Gmail, Gsuite, Outlook). In Magento, you will need a module to make this possible.
This will work assuming that you have configured your email provider and DNS to work together so that you can use your domain name (email@example.com) with your inbox.
An added advantage of this is that all emails sent (order confirmations, and more) will be visible in the sent folder of your account.
Checking for problems¶
There are a couple of checks that can be made to get to the bottom of deliverability issues with emails. Both are provided by MxToolbox.
The first check is an Mx record check of the domain, this will also clarify where emails should originate from for a specific domain MX Record Check
Secondly, the SPF record should be valid, MXToolbox will flag problems if this is not setup correctly. This is also offered through MxToolbox