Gets or sets how the component should establish TLS/SSL connection with the mail server.
Namespace: MailBee.Pop3MailAssembly: MailBee.NET (in MailBee.NET.dll) Version: 12.5.0 build 687 for .NET 4.5
Syntax public SslStartupMode SslMode { get; set; }
Public Property SslMode As SslStartupMode
Get
Set
Property Value
Type:
SslStartupModeOne of
SslStartupMode values specifying if and how
the component should establish TLS/SSL connection with the mail server. The default value is
Manual which means the connection won't be established
in TLS/SSL mode unless the developer manually calls
StartTls method.
Remarks AutodetectPortAndSslMode property may cause MailBee to automatically enable TLS/SSL for some well-known hosts or ports
even if SslMode property has its default value.
Note |
---|
Not all mail servers support TLS/SSL functionality. Also, some servers support only newest TLS versions
(see SslProtocol topic for details). |
Examples This sample connects to the mail server on regular port 110, then switches
the connection into TLS/SSL mode using STLS command, logs in the mail account and downloads the
first mail message in this account.
using MailBee;
using MailBee.Pop3Mail;
using MailBee.Security;
using MailBee.Mime;
Pop3 pop = new Pop3();
pop.SslMode = SslStartupMode.UseStartTls;
pop.Connect("mail.domain.com");
pop.Login("jdoe", "secret");
if (pop.InboxMessageCount > 0)
{
MailMessage msg = pop.DownloadEntireMessage(pop.InboxMessageCount);
Console.WriteLine(msg.Attachments.Count + " attachment(s) in the message.");
}
pop.Disconnect();
Imports MailBee
Imports MailBee.Pop3Mail
Imports MailBee.Security
Imports MailBee.Mime
Dim pop As New Pop3
pop.SslMode = SslStartupMode.UseStartTls
pop.Connect("mail.domain.com")
pop.Login("jdoe", "secret")
If pop.InboxMessageCount > 0 Then
MailMessage msg = pop.DownloadEntireMessage(pop.InboxMessageCount);
Console.WriteLine(msg.Attachments.Count & " attachment(s) in the message.");
End If
pop.Disconnect();
See Also