Requests the mail server to start TLS/SSL negotiation and protect the connection with
security layer.
Namespace: MailBee.ImapMailAssembly: MailBee.NET.45 (in MailBee.NET.45.dll) Version: 10.0.45.502
SyntaxPublic Function StartTls As Boolean
Return Value
Type:
Booleantrue if TLS/SSL negotiation succeeded and the connection is now secured with TLS/SSL layer; otherwise,
false.
Exceptions
Remarks
As alternative to calling
StartTls method, the developer can ask MailBee to start
TLS/SSL negotiation automatically by setting
SslMode property value to
OnConnect
or
UseStartTls.
Note |
---|
Not all mail servers support TLS/SSL functionality. |
Examples
This sample attempts to establish TLS/SSL connection with the IMAP4 server and displays the number
of messages in the inbox on success.
using MailBee;
using MailBee.ImapMail;
Imap imp = new Imap();
imp.Connect("mail.domain.com");
imp.StartTls();
imp.Login("jdoe", "secret");
imp.SelectFolder("Inbox");
Console.WriteLine(imp.MessageCount);
imp.Disconnect();
Imports MailBee
Imports MailBee.ImapMail
Dim imp As New Imap
imp.Connect("mail.domain.com")
imp.StartTls()
imp.Login("jdoe", "secret")
imp.SelectFolder("Inbox")
Console.WriteLine(imp.MessageCount)
imp.Disconnect()
See Also