Getting SmtpClient to work with a self signed SSL certificate?

You may take a look at the ServerCertificateValidationCallback property.

You may take a look at the ServerCertificateValidationCallback property: ServicePointManager. ServerCertificateValidationCallback = (sender, certificate, chain, sslPolicyErrors) => true; It represents a callback which is called by the runtime when it tries to validate an SSL certificate. By returning true you basically say that you don't care if the certificate is valid or not -> you always accept it.

Of course having self signed certificates in production environment is not a good idea.

I did look into the ServicePoint angle a little bit but I saw this comment on the ServicePoint/Members doc page "Provides connection management for HTTP connections" so I get the impression it won't be used for SMTP. Plus when I try it and put a log message in the callback it's never called. – sipwiz Jan 28 '10 at 10:47 You need to put this before making any attempts to instantiate the SmtpClient class, ideally in some global initialization section of your application.

– Darin Dimitrov Jan 28 '10 at 10:49.

My issue ended up being that the . Net SmtpClient class apparently doesn't support the use of port 465 for SMTP SSL connections. Using port 25 with a self signed SSL certificate worked correctly.

MSDN System. Net forum question Can SmtpClient be configured to work with a self signed certificate?.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions