Value

This event is raised just before MailBee will start making the connection (i.e. before SocketConnected event).
This lets you specify your own socket object in case if you need some special socket settings. For instance, configure SSL settings for new sockets in UWP apps.
If you need this, set NewSocket property to the socket object needed in your event handler.

Note

It's possible that this event will fire multiple times in case if the host has multple endpoints assigned. For instance, if the first endpoint was IPv6,
the connection could not be made but second endpoint (IPv4) would succeed. On each call of this event handler, your code must supply a new, fresh socket object (otherwise MailBee
will create its own). By default, however, MailBee tries IPv4 addresses first (see PreferIPv4Hosts) so this situation is unlikely to happen.

Examples

This code snippet shows how to ignore some SSL certificate errors when making SSL/TLS connections in a UWP app (useful if you connect to local hosts with self-signed certificates, etc).