I have an app service in azure that hosts rest api app and vnet integration enabled and have a web subnet and do not have any private end points. The rest api has following code that will send email string smtpHostUrl = "smtp.abcde";
var client = new SmtpClient(smtpHostUrl)
{
Port = 25,
Credentials = new NetworkCredential(smtpAuthUsername, smtpAuthPassword),
EnableSsl = false
};
When I try to hit api end point to send email from postman getting System.Net.Mail.SmtpException exception in application insights. It looks like the DNS server cannot resolve hostname "smtp.abc".Do I need to configure custom dns server in vnet ?Will it resolve my issue ?
planning to configure custom dns server setting in Azure vnet, not sure what ip address I have to specify here.It has two IP addresses