VikasKumar-3320, If you're leveraging Azure WebApps service and looking for configuring email, please let us know.
I have re-tagged the thread to receive insights from the targetted audience.
In case you're using Azure WebApps - Review the configuration for the WebApp -- it is suggested to use authenticated SMTP relay services. And sending the email without these may be blocked by external domain or will be marked as spam or will cause other issues.
Please refer to the following link for the details:
Troubleshoot outbound SMTP connectivity in Azure | Microsoft Learn
--See this information - This is a Proof of Concept to send email using the PHP Mailer library and Office 365.
Send email on App Service using Office 365 (O365)
Additionally, you could send emails with Gmail from your App Service app by using Azure Logic Apps. Logic Apps brings a lot more power to your App Service app without adding complexity to your code.
Tutorial: Send email and invoke other business processes from App Service
Refer this doc -Recommended method of sending email
--
To benefit the community find the right answers, please do mark the post which was helpful by clicking on ‘Accept Answer’ & ‘Up-Vote’.