Hello,
In order you could use your Office 365 account mail merge and send email, you should use Office 365 API as well. By using the API Key you could generate from your Azure Portal, you could authorize your PHP code to use these service as well. I already have the code written in PHP for this purpose. Let me know more specific requirement, if any, so I could review
Regards
Khamid