Welcome to the Microsoft Q&A Platform. Thank you for reaching out & I hope you are doing well.
I understand that you would like to establish a connection between Azure App Service and OnPrem SMTP Server.
You can consider using Azure App Service VNet Integration and integrate the AppService in the VNet where the ExpressRoute Gateway is deployed.
Refer : App Service networking features
Please make sure you review and validate the restrictions and limitations associated with VNet Integration
Kindly let us know if the below helps or you need further assistance on this issue.
Please don’t forget to close the thread by clicking "Accept the answer" wherever the information provided helps you, as this can be beneficial to other community members.