Git Product home page Git Product logo

Comments (1)

jstedfast avatar jstedfast commented on June 1, 2024
  • Is it required to set a proxy before connect?

Yes. Honestly, it wouldn't really make sense to set the proxy after connect since the whole point of a proxy is that it is used to establish a connection and to then act as a middle-man for the client and server to talk to each other after that.

  • Can the proxy be changed after connect?

I don't remember off-hand if setting the ImapClient.Proxy property (for example) will throw an exception if you try to set it to a new value after connecting, but setting it to a new value wouldn't do anything until you tried to establish a new connection, so it would be pointless to set it to a different proxy mid-session.

  • How is the proper use of sockets4/5, etc?

I'm guessing you mean SOCKS4 (and SOCKS4A) and SOCKS5? Those are proxy protocols and you'd need to find out which version of the SOCKS protocol that your proxy server uses in order to decide which one to use.

The way that you'd typically use a proxy in MailKit is very simple:

using (var client = new SmtpClient ()) {
    client.Proxy = new Socks5Proxy ("socks5.proxy.com", 1080, new NetworkCredentials ("proxyUserName", "proxyPassword"));
    client.Connect ("smtp.gmail.com", 465, SecureSocketOptions.SslOnConnect);
    client.Authenticate ("[email protected]", "password");
    client.Send (message);
    client.Disconnect (true);
}

from mailkit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.