I am using following code to send email. The Code works correctly in my local Machine. But on Production server i am getting the error message
var fromAddres
I tried all of the suggestions found here, from enabling less secure apps, to trying port 587... nothing worked. Finally I just commented out the line UseDefaultCredentials = false. Everything worked if I didn't touch that boolean.
UseDefaultCredentials = false