calgia
It sounds like you don’t have SMTP properly configured for your system email. When SMTP fails (or is not configured at all) the system uses the local webserver to send mail on behalf of your domain (usually via sendmail). If that’s the case and your domain doesn’t have SPF properly configured then mail will likely not pass SPF checks and will likely be marked as spam. Ideally, in normal scenarios, you want to configure SMTP so that outbound mail from the system is sent through your mail provider's servers which will ensure the best chance of deliverability.
If you can’t configure SMTP then yes, definitely configure SPF. You may want DKIM setup as well. However, we can’t tell you which records to use are as we do not run your DNS nor mailserver. You would need to contact your mail administrator and/or hosting provider to get the appropriate records to add to your DNS.
With all this being said, to configure SMTP for an O365 email you first need to upgrade to v1.17.5/v1.18.1, install/activate the OAuth2 plugin, ensure URL Rewriting is enabled and allowed on your webserver/site, and configure Modern Authentication (OAuth2 - Microsoft) for the system email. Here is our OAuth2 Authorization Guide (Modern Authentication for Emails) with full instructions on how to configure it. Once Modern Auth is configured you’ll simply input O365's SMTP info, enable SMTP on the Outgoing tab, and Save Changes to test the connection. If it gives you a green banner then you can do a final test using the Admin Panel > Emails > Diagnostic tool.
Cheers.