GlobalLicenseKey Property
Assigns the license key.

Namespace: MailBee
Assembly: MailBee.NET (in MailBee.NET.dll) Version: 11.2.0 build 590 for .NET 4.5
Syntax
public static string LicenseKey { get; set; }

Property Value

Type: String
A string value which contains the license key which unlocks the component. This property is write-only.
Exceptions
ExceptionCondition
MailBeeLicenseExceptionThe license key is invalid.
Remarks

You can unlock MailBee.NET Objects by setting this property to the valid permanent or trial license key or by adding MailBee.Global.LicenseKey key in app.config, web.config, or machine.config file. The 3rd method is to pass the license key as a parameter when calling a constructor which creates an instance of a component.

This property is static (Shared in Visual Basic). If not set in the config file, this property must be set before using any static methods creating any instances of Global class.

Examples
Setting this property and creating instances of all licensed classes.
// To use the code below, import MailBee namespaces at the top of your code
using MailBee.AntiSpam;
using MailBee.ImapMail;
using MailBee.Outlook;
using MailBee.Pdf;
using MailBee.Pop3Mail;
using MailBee.Security;
using MailBee.SmtpMail;

// The actual code (put it into a method of your class)
MailBee.Global.LicenseKey = "Permanent or trial license key here";
BayesFilter filter = new BayesFilter();
Imap imp = new Imap();
MsgConvert conv_msg = new MsgConvert();
PstReader reader = new PstReader(@"C:\OutlookMessageBase\Outlook.pst");
HtmlToPdf conv_pdf = new HtmlToPdf();
Pop3 pop = new Pop3();
Smime sm = new Smime();
Smtp mailer = new Smtp();
Examples
Setting the license key in the config file and creating instances of all licensed classes.
// To use the code below, import MailBee namespaces at the top of your code
using MailBee.AntiSpam;
using MailBee.ImapMail;
using MailBee.Outlook;
using MailBee.Pdf;
using MailBee.Pop3Mail;
using MailBee.Security;
using MailBee.SmtpMail;

// The actual code (put it into a method of your class)
BayesFilter filter = new BayesFilter();
Imap imp = new Imap();
MsgConvert conv_msg = new MsgConvert();
PstReader reader = new PstReader(@"C:\OutlookMessageBase\Outlook.pst");
HtmlToPdf conv_pdf = new HtmlToPdf();
Pop3 pop = new Pop3();
Smime sm = new Smime();
Smtp mailer = new Smtp();

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

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

// In .NET 2.0, it can be <applicationSettings> instead of <appSettings>.
See Also