本文整理汇总了C#中hMailServer.Start方法的典型用法代码示例。如果您正苦于以下问题:C# hMailServer.Start方法的具体用法?C# hMailServer.Start怎么用?C# hMailServer.Start使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类hMailServer
的用法示例。
在下文中一共展示了hMailServer.Start方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetupSSLPorts
public static void SetupSSLPorts(hMailServer.Application application, SslVersions sslVersions = null)
{
SSLCertificate sslCeritifcate = SetupSSLCertificate(application);
var settings = application.Settings;
var ports = settings.TCPIPPorts;
ports.SetDefault();
AddPort(ports, 25000, eConnectionSecurity.eCSNone, sslCeritifcate.ID, eSessionType.eSTSMTP);
AddPort(ports, 11000, eConnectionSecurity.eCSNone, sslCeritifcate.ID, eSessionType.eSTPOP3);
AddPort(ports, 14300, eConnectionSecurity.eCSNone, sslCeritifcate.ID, eSessionType.eSTIMAP);
AddPort(ports, 25001, eConnectionSecurity.eCSTLS, sslCeritifcate.ID, eSessionType.eSTSMTP);
AddPort(ports, 11001, eConnectionSecurity.eCSTLS, sslCeritifcate.ID, eSessionType.eSTPOP3);
AddPort(ports, 14301, eConnectionSecurity.eCSTLS, sslCeritifcate.ID, eSessionType.eSTIMAP);
AddPort(ports, 25002, eConnectionSecurity.eCSSTARTTLSOptional, sslCeritifcate.ID, eSessionType.eSTSMTP);
AddPort(ports, 11002, eConnectionSecurity.eCSSTARTTLSOptional, sslCeritifcate.ID, eSessionType.eSTPOP3);
AddPort(ports, 14302, eConnectionSecurity.eCSSTARTTLSOptional, sslCeritifcate.ID, eSessionType.eSTIMAP);
AddPort(ports, 25003, eConnectionSecurity.eCSSTARTTLSRequired, sslCeritifcate.ID, eSessionType.eSTSMTP);
AddPort(ports, 11003, eConnectionSecurity.eCSSTARTTLSRequired, sslCeritifcate.ID, eSessionType.eSTPOP3);
AddPort(ports, 14303, eConnectionSecurity.eCSSTARTTLSRequired, sslCeritifcate.ID, eSessionType.eSTIMAP);
settings.SslVersion30Enabled = sslVersions == null || sslVersions.Ssl30;
settings.TlsVersion10Enabled = sslVersions == null || sslVersions.Tls10;
settings.TlsVersion11Enabled = sslVersions == null || sslVersions.Tls11;
settings.TlsVersion12Enabled = sslVersions == null || sslVersions.Tls12;
application.Stop();
application.Start();
}
示例2: SetupSSLPorts
public static void SetupSSLPorts(hMailServer.Application application)
{
SSLCertificate sslCeritifcate = SetupSSLCertificate(application);
var ports = application.Settings.TCPIPPorts;
AddPort(ports, 25000, eConnectionSecurity.eCSNone, sslCeritifcate.ID, eSessionType.eSTSMTP);
AddPort(ports, 11000, eConnectionSecurity.eCSNone, sslCeritifcate.ID, eSessionType.eSTPOP3);
AddPort(ports, 14300, eConnectionSecurity.eCSNone, sslCeritifcate.ID, eSessionType.eSTIMAP);
AddPort(ports, 25001, eConnectionSecurity.eCSTLS, sslCeritifcate.ID, eSessionType.eSTSMTP);
AddPort(ports, 11001, eConnectionSecurity.eCSTLS, sslCeritifcate.ID, eSessionType.eSTPOP3);
AddPort(ports, 14301, eConnectionSecurity.eCSTLS, sslCeritifcate.ID, eSessionType.eSTIMAP);
AddPort(ports, 25002, eConnectionSecurity.eCSSTARTTLSOptional, sslCeritifcate.ID, eSessionType.eSTSMTP);
AddPort(ports, 11002, eConnectionSecurity.eCSSTARTTLSOptional, sslCeritifcate.ID, eSessionType.eSTPOP3);
AddPort(ports, 14302, eConnectionSecurity.eCSSTARTTLSOptional, sslCeritifcate.ID, eSessionType.eSTIMAP);
AddPort(ports, 25003, eConnectionSecurity.eCSSTARTTLSRequired, sslCeritifcate.ID, eSessionType.eSTSMTP);
AddPort(ports, 11003, eConnectionSecurity.eCSSTARTTLSRequired, sslCeritifcate.ID, eSessionType.eSTPOP3);
AddPort(ports, 14303, eConnectionSecurity.eCSSTARTTLSRequired, sslCeritifcate.ID, eSessionType.eSTIMAP);
application.Stop();
application.Start();
}
示例3: SetupSSLPorts
public static void SetupSSLPorts(hMailServer.Application application, eConnectionSecurity security)
{
SSLCertificate sslCeritifcate = SetupSSLCertificate(application);
TCPIPPort port = application.Settings.TCPIPPorts.Add();
port.Address = "0.0.0.0";
port.PortNumber = 250;
port.ConnectionSecurity = security;
port.SSLCertificateID = sslCeritifcate.ID;
port.Protocol = eSessionType.eSTSMTP;
port.Save();
port = application.Settings.TCPIPPorts.Add();
port.Address = "0.0.0.0";
port.PortNumber = 11000;
port.ConnectionSecurity = security;
port.SSLCertificateID = sslCeritifcate.ID;
port.Protocol = eSessionType.eSTPOP3;
port.Save();
port = application.Settings.TCPIPPorts.Add();
port.Address = "0.0.0.0";
port.PortNumber = 14300;
port.ConnectionSecurity = security;
port.SSLCertificateID = sslCeritifcate.ID;
port.Protocol = eSessionType.eSTIMAP;
port.Save();
application.Stop();
application.Start();
}