Mailkit: Proxy and mailkit 1.10.0

Created on 7 Sep 2019  路  1Comment  路  Source: jstedfast/MailKit

Hi, I really liked your library, but I had a problem (not because of your project). I use mailkit 1.10.0 (I can鈥檛 update, I use visual studio 2010 and nuget 2.8) and would like to connect a proxy to it, but nothing works. please tell me how to use proxies in mailkit 1.10.0?

question

Most helpful comment

SmtpClient, Pop3Client and ImapClient all have a Connect() method that takes a Stream.

You'll need to write code to connect to your SMTP/POP3/IMAP server via whatever proxy you have using a System.Net.Socket and then wrap that Socket in a System.Net.NetworkStream once you've connected and then pass that to the *Client.Connect (Stream, ...) method.

If you want to see how to write code that will do that, look at the latest source code for MailKit and check out the source files for the MailKit.Net.Proxy namespace: https://github.com/jstedfast/MailKit/tree/master/MailKit/Net/Proxy

>All comments

SmtpClient, Pop3Client and ImapClient all have a Connect() method that takes a Stream.

You'll need to write code to connect to your SMTP/POP3/IMAP server via whatever proxy you have using a System.Net.Socket and then wrap that Socket in a System.Net.NetworkStream once you've connected and then pass that to the *Client.Connect (Stream, ...) method.

If you want to see how to write code that will do that, look at the latest source code for MailKit and check out the source files for the MailKit.Net.Proxy namespace: https://github.com/jstedfast/MailKit/tree/master/MailKit/Net/Proxy

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ghost picture ghost  路  3Comments

MaximKiselev picture MaximKiselev  路  7Comments

truane picture truane  路  4Comments

dbogatov picture dbogatov  路  7Comments

rgmills picture rgmills  路  6Comments