@Daniel Bäuerlein Thanks for reaching out. You cannot send a mail using mail() function since SMTP connections on TCP port 25 is blocked in Azure and it is suggested to use either SendGrid or Logic apps.
- This guide demonstrates how to perform common programming tasks with the SendGrid email service on Azure. The samples are written in PHP. The scenarios covered include constructing email, sending email, and adding attachments.
- Refer to this documentation steps, if you want to send emails with Gmail from your App Service app by using Azure Logic Apps.
Feel free to reach back to me if you have further queries on this.