I am using OpenPOP
I am trying to retrieve mail from an in office exchange server. This is my code
popClient.Connect(host.Host, (int)host.Port, (bool)host.Ssl);
popClient.Authenticate(host.Username, host.Password);
Prodlem is the SSL Certificate is created in iis 7 and isnt a valid certificate is there any way for my to bypass this.
It gives me the error remote certificate is invalid according to the validation procedure.
Yes, there is a way. It requires some small code changes is the POPClient class.
Step 1: Replace the constructor for the SslStream instance that is used to authenticate the server with one that allows you to provide a delegate for validating the certificate supplied by the remote party. Therefore replace
from POPClient class, Connect method with
Step 2: Provide the method that is called by the delegate and force the validation of the remote certificate by returning always true:
For further details on this subject, please check the documentation available on msdn.