Used for communicating through a Socks4 or Socks5 proxy server to the IMAP server.
For a list of all members of this type, see IMAPProxy Members.
System.Object
IMAPProxy
Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.
[C#]
IMAP4 imap = new IMAP4( "mail.example.com" );
imap.Logger = new IMAPLog();
imap.Logger.Overwrite = true;
imap.Logger.Path = "C:\\imap.log";
//create the proxy object
IMAPProxy proxy = new IMAPProxy( "proxy1.example.com", 8080 );
proxy.Username = "jdoe";
proxy.Password = "secret";
proxy.Authentication = IMAPProxyAuthentication.UsernamePassword;
proxy.Type= IMAPProxyType.Socks5;
//set it on the IMAP object
imap.Proxy = proxy;
imap.Login("test@example.com", "test" );
//list the folders
MailFolderCollection folders = imap.FolderList();
foreach( MailFolder folder in folders )
{
Console.WriteLine( folder.Name );
}
imap.Disconnect();
[VB.NET]
Dim imap As New IMAP4("mail.example.com")
imap.Logger = New IMAPLog()
imap.Logger.Overwrite = True
imap.Logger.Path = "C:\imap.log"
'create the proxy object
Dim proxy As New IMAPProxy("proxy1.example.com", 8080)
proxy.Username = "jdoe"
proxy.Password = "secret"
proxy.Authentication = IMAPProxyAuthentication.UsernamePassword
proxy.Type = IMAPProxyType.Socks5
'set it on the IMAP object
imap.Proxy = proxy
imap.Login("test@example.com", "test")
'list the folders
Dim folders As MailFolderCollection = imap.FolderList()
Dim folder As MailFolder
For Each folder In folders
Console.WriteLine(folder.Name)
Next folder
imap.Disconnect()
Namespace: aspNetIMAP
Assembly: aspNetIMAP (in aspNetIMAP.dll)