I want to send email in ASP.NET MVC website but it doesn't work.
I think the problem is with this exception here
'client.ServicePoint.Address' threw an exception of type 'System.NotSupportedException' with type System.Uri {System.NotSupportedException}.
after the code
var client = new SmtpClient("smtp.office365.com", 25)
In this document https://learn.microsoft.com/en-us/dotnet/api/system.net.servicepoint.address?view=netcore-3.1, it says the exception is due to "The ServicePoint is in host mode." which I have no idea.
Could anyone explain it and tell me how to resolve?
Thanks,