| MailServiceProxyClient Property |
Get or set the proxy client to use when connecting to a remote host.
Namespace: MailKitAssembly: MailKit (in MailKit.dll) Version: 4.7.1
Syntax Remarks
Gets or sets the proxy client to use when connecting to a remote host via any of the
Connect methods.
Example public static void SendMessageViaProxy (MimeMessage message)
{
using (var client = new SmtpClient ()) {
client.ProxyClient = new Socks5Proxy ("socks5.proxy.com", 1080, new NetworkCredentials ("proxyUserName", "proxyPassword"));
client.Connect ("smtp.gmail.com", 465, SecureSocketOptions.SslOnConnect);
client.Authenticate ("username", "password");
client.Send (message);
client.Disconnect (true);
}
}
See Also