I couldn't reproduce your issue with Sendmail. I installed it in the server running the command below and it was detected without issues by Joomla
sudo apt-get install -y sendmail
Can you check it is properly installed on your server?
sudo which sendmail
Also, I'm afraid I don't know how to configure sendmail for sending emails using Office365. Can you check it in a more generic forum like Stackoverflow or the Joomla official forums?
Apart from that, do you know if using sendmail is strictly necessary on your case? Can you try if configuring Joomla with
SMTP instead of
sendmail, and setting the Office365 information works for you?
You can get the official SMTP configuration for Office365 from the link below