Is there a way to set the EnableSSL from the web.config?
I could set this property in code, but that wouldn\'t work for the Simple Mail Web Event and other classes t
I have a dirty workaround (until .NET 4.0 comes out). Instead of changin my code it relies on the used port to determine if SSL is required or not.
var client = new SmtpClient();
client.EnableSsl = client.Port == 587 || client.Port == 465;
// This could also work
//client.EnableSsl = client.Port != 25;
I said it was a dirty hack, but it working fine for the different configurations that we encounter.