Sending email == Simple.
Having 100% deliverability == Gnarly Complex.
Either use MailGun or SendGrid... or strap yourself in for a time sucking adventure.
Here's what's required.
1) You MX records provide reverse DNS lookup correctly.
2) Your SPF DNS record must be correct.
3) Each outgoing email message must be correctly DKIM signed.
4) Your DMARC DNS record must be correct.
5) You must correctly manage your return loop, so every temporary/permanent message returned to your server from another server must be processed + acted upon correctly.
6) You must remove your IP from various blacklists, when your competitors flag you as a spammer.
7) After #1 - #4 are correct, you must warm your IP which means sending some of your email each day out this new IP, so your IP builds reputation. This process can take days to weeks, based on many factors... including if you correctly set your header Precedence: bulk. If you some how skip/miss this, likely Google/Gmail will never accept email from you or email acceptance will be inconsistent/spotty.
So... Best to use MailGun or SendGrid. They take care of all this for you.