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
Kindly let us know if the below helps or you need further assistance on this issue.
Thanks,
Kapil
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.