
Azure App Service provides a fully managed, platform as a service hosting solution (https://learn.microsoft.com/en-us/azure/developer/intro/hosting-apps-on-azure). It is designed to be a secure environment, and to prevent spam, most cloud service providers, including Azure, have blocked outbound connections on the SMTP ports.
There are email service providers that allow sending emails through their API, and these should work fine within Azure App Services, as HTTP and HTTPS ports are open for outbound connections. Services like SendGrid, Mailgun, or Mailjet provide APIs for sending email.
Or you can use System.Net.Mail.SmtpClient or similar library to send email using an external provider