MailKit icon indicating copy to clipboard operation
MailKit copied to clipboard

Is this the right way to use Proxy Support?

Open nik0s100 opened this issue 7 years ago • 3 comments

So I'm trying to connect via A sock5 port into imap Client. I cant set UserName I get NullReference. The current example is with example links none are real host etc..

using (var client = new ImapClient())
{
    client.ProxyClient = new Socks5Client("host", 88);
   client.ProxyClient.ProxyCredentials.UserName = "username";
   client.ProxyClient.ProxyCredentials.Password = "password";

   client.ProxyClient.Connect("imap.example.com", 9951);
   client.Authenticate("mail", "passowrd");
}

nik0s100 avatar Mar 10 '19 17:03 nik0s100

No.

using (var client = new ImapClient ()) {
    var credentials = new NetworkCredential ("username", "password");
    client.ProxyClient = new Socks5Client ("host", 88, credentials);
    client.Connect ("imap.example.com", 995, SecureSocketOptions.SslOnConnect);
    client.Authenticate ("username", "password");
}

jstedfast avatar Mar 10 '19 19:03 jstedfast

Hello Jeffrey,

is it the same approach for smtp client please?

Thanks.

OleksiiShabala avatar Mar 27 '19 16:03 OleksiiShabala

Yes, it is the same for all clients.

jstedfast avatar Mar 27 '19 17:03 jstedfast