MailBee.NET Objects 3.1

Imap.LicenseKey Property

Sets the license key to be used to unlock MailBee.NET IMAP4 component.

public static string LicenseKey {get; set;}

Property Value

A string value containing the license key which unlocks MailBee.NET IMAP4 component. This property is write-only.

Remarks

You can unlock MailBee.NET IMAP4 component by either setting this property to the valid permanent or trial license key, or by adding MailBee.ImapMail.Imap.LicenseKey key in app.config, web.config, or machine.config file.

This property is static (Shared in Visual Basic). If not set in the config file, this property must be set before any method of Imap component gets called.

Exceptions

Exception TypeCondition
MailBeeLicenseExceptionThe specified license key is invalid.

Example

Setting this property and connecting to an IMAP4 server.

[C#]
// To use the code below, import MailBee namespaces at the top of your code.
using MailBee;
using MailBee.ImapMail;

// The actual code (put it into a method of your class).
Imap.LicenseKey = "Permanent or trial license key here";
Imap imp = new Imap();
imp.Connect("mail.domain.com");
imp.Disconnect();
[Visual Basic]
' To use the code below, import MailBee namespaces at the top of your code.
Imports MailBee
Imports MailBee.ImapMail

' The actual code (put it into a method of your class).
Imap.LicenseKey = "Permanent or trial license key here"
Dim imp As New Imap
imp.Connect("mail.domain.com")
imp.Disconnect()
Setting the license key in the config file and connecting to an IMAP4 server.
[C#]
// To use the code below, import MailBee namespaces at the top of your code.
using MailBee;
using MailBee.ImapMail;

// The actual code (put it into a method of your class).
Imap imp = new Imap();
imp.Connect("mail.domain.com");
imp.Disconnect();

// XML config file (app.config, web.config, or machine.config):

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="MailBee.ImapMail.Imap.LicenseKey" value="Permanent or trial license key here"/>
</appSettings>
</configuration>

// In .NET 2.0, it can be <applicationSettings> instead of <appSettings>.
[Visual Basic]
Imports MailBee
Imports MailBee.ImapMail

' The actual code (put it into a method of your class).
Dim imp As New Imap
imp.Connect("mail.domain.com")
imp.Disconnect()

' XML config file (app.config, web.config, or machine.config):

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="MailBee.ImapMail.Imap.LicenseKey" value="Permanent or trial license key here"/>
</appSettings>
</configuration>

' In .NET 2.0, it can be <applicationSettings> instead of <appSettings>.

See Also

Imap Class | MailBee.ImapMail Namespace