Provides access to the settings which allow MailBee to connect to a mail server via a proxy server.
Namespace: MailBee.ImapMailAssembly: MailBee.NET (in MailBee.NET.dll) Version: 12.5.0 build 687 for .NET 4.5
Syntax public ProxyServer Proxy { get; }
Public ReadOnly Property Proxy As ProxyServer
Get
Property Value
Type:
ProxyServerA reference to the proxy server settings.
Remarks
By default, proxy server is not used. The developer can change this to make MailBee use SOCKS4, SOCKS5, or HTTP proxy server.
This is useful when a firewall prohibits direct connections with a mail server but permits connections via a proxy.
Examples
This console sample establishes connection with the mail server via an HTTP proxy server which requires clients to authenticate themselves.
using System;
using MailBee;
using MailBee.ImapMail;
using MailBee.Proxy;
class Sample
{
static void Main(string[] args)
{
Imap imp = new Imap();
imp.Proxy.Name = "proxy.server.com";
imp.Proxy.Protocol = ProxyProtocol.Http;
imp.Proxy.Port = 808;
imp.Proxy.AccountName = "jdoe";
imp.Proxy.Password = "secret";
imp.Connect("mail.company.com");
Console.WriteLine("Connected via a proxy server");
imp.Disconnect();
}
}
Imports System
Imports MailBee
Imports MailBee.ImapMail
Imports MailBee.Proxy
Class Sample
Shared Sub Main(ByVal args() As String)
Dim imp As Imap = New Imap
imp.Proxy.Name = "proxy.server.com"
imp.Proxy.Protocol = ProxyProtocol.Http
imp.Proxy.Port = 808
imp.Proxy.AccountName = "jdoe"
imp.Proxy.Password = "secret"
imp.Connect("mail.company.com")
Console.WriteLine("Connected via a proxy server")
imp.Disconnect()
End Sub
End Class
See Also