IProxyClient Interface

An interface for connecting to services via a proxy.

Definition

Namespace: MailKit.Net.Proxy
Assembly: MailKit (in MailKit.dll) Version: 5.0.0
C#
public interface IProxyClient

Remarks

Example

C#
                    public static void SendMessageViaProxy (MimeMessage message)
{
    using (var client = new SmtpClient ()) {
        client.ProxyClient = new Socks5Client ("socks5.proxy.com", 1080, new NetworkCredential ("proxyUserName", "proxyPassword"));
        client.Connect ("smtp.gmail.com", 465, SecureSocketOptions.SslOnConnect);
        client.Authenticate ("username", "password");

        client.Send (message);

        client.Disconnect (true);
    }
}
                  

Properties

LocalEndPoint Get or set the local IP end point to use when connecting to a remote host.
ProxyCredentials Gets the proxy credentials.
ProxyHost Get the proxy host.
ProxyPort Get the proxy port.

Methods

Connect(String, Int32, CancellationToken) Connect to the target host.
Connect(String, Int32, Int32, CancellationToken) Connect to the target host.
ConnectAsync(String, Int32, CancellationToken) Asynchronously connect to the target host.
ConnectAsync(String, Int32, Int32, CancellationToken) Asynchronously connect to the target host.

See Also