Click or drag to resize
MimeKit

MailServiceDefaultServerCertificateValidationCallback Method

The default server certificate validation callback used when connecting via SSL or TLS.

Namespace:  MailKit
Assembly:  MailKit (in MailKit.dll) Version: 2.10.0
Syntax
C#
protected bool DefaultServerCertificateValidationCallback(
	Object sender,
	X509Certificate certificate,
	X509Chain chain,
	SslPolicyErrors sslPolicyErrors
)

Parameters

sender
Type: SystemObject
The object that is connecting via SSL or TLS.
certificate
Type: System.Security.Cryptography.X509CertificatesX509Certificate
The server's SSL certificate.
chain
Type: System.Security.Cryptography.X509CertificatesX509Chain
The server's SSL certificate chain.
sslPolicyErrors
Type: System.Net.SecuritySslPolicyErrors
The SSL policy errors.

Return Value

Type: Boolean
true if the certificate is deemed valid; otherwise, false.
Remarks

The default server certificate validation callback recognizes and accepts the certificates for a list of commonly used mail servers such as gmail.com, outlook.com, mail.me.com, yahoo.com, and gmx.net.

See Also