Using License Keys

Trial license key

During downloading MailBee.NET Objects package, you can get a trial license key which allows you to evaluate MailBee.NET Objects in fully-functional mode for a period of 30 days. You can also get the trial key using Get a Trial Key tool in MailBee.NET Start Menu launcher.

Permanent license key

When you purchase a license for MailBee.NET Objects library or any individual part of this library (such as MailBee.NET POP3), you receive a permanent license key which allows you to use the licensed components for an unlimited period of time.

There are no trial or permanent versions of MailBee.NET Objects library. Single version of the package is used in both trial and permanent mode. The status of whether the library is working in trial or permanent mode is fully controlled by the license key.

Assigning the license key

With .NET Framework, you can use ANY method of the listed below, to specify the license key. With .NET Core and UWP, setting the key directly in code is the only option.

The license key (either trial or permanent) needs to be specified in the config file (such as app.config, web.config, machine.config), or in the static (Shared in Visual Basic) MailBee.Global.LicenseKey property, or directly in the constructor of the component you're instantiating. Setting the license key in the config file is the preferred method (unless you need to redistribute the application and thus hide the license key from the end user).

  1. Setting the license key in the config file (app.config, web.config, machine.config):

    <?xml version="1.0" encoding="utf-8" ?>
    <configuration>
      <appSettings>
        <!-- License key for MailBee.NET -->
        <!-- Note that MN120-0123456789ABCDEF-0123 is not a real key. Use your key instead. -->
        <add key="MailBee.Global.LicenseKey" value="MN120-0123456789ABCDEF-0123"/>
      </appSettings>
    </configuration>
    

You should NOT attempt to specify the license key in appname.exe.config file created by Visual Studio in Debug or Release folder of the project. Visual Studio overwrites this file during rebuilding the project.

  1. Setting the license key using LicenseKey property (you should set this property before creating any instances of the licensed component):

    MailBee.Global.LicenseKey = "MN120-0123456789ABCDEF-0123";
    

    If you redistribute the application to third-parties without the source code, embedding the key in the code may be the preferred method of hiding the license key from end users.

  2. Setting the license key and creating an instance at the same time:

    MailBee.ImapMail.Imap imapComponent = new Imap("MN120-0123456789ABCDEF-0123");
    
    Dim imapComponent As New MailBee.ImapMail.Imap("MN120-0123456789ABCDEF-0123")
    
    In fact, #3 is a shorthand form of the previous method.
    
    1. Placing the license key into Windows registry (the license key will be saved in the registry in an encoded form, thus you can also use this method in case if you need to redistribute the application).

      To put the license key into the registry, you can use SaveKey or SaveKeyGui utilities which are located in MailBee.NET Objects installation folder. You can quickly start SaveKeyGui utility by clicking "Save License Key to Registry" item in MailBee.NET Start Menu.

      SaveKeyGui provides friendly interface to the user while SaveKey console application is intended to be used by installation programs. If you need to put the license key into Windows registry programmatically, call SaveKey utility with parameters. To learn how to use this utility, run it in a command-line not specifying any parameters.

      SaveKey utility also has an option to put the license key in machine.config file (although it's not recommended to use this option since the machine.config file will be reformatted).

      Note 1 You should use "Run as Administrator" option under Windows Vista and above in order to use SaveKey and SaveKeyGui utilities.

      Note 2 Make sure your application has the permission to read Windows registry (by default, ASP.NET applications may have some limitations on reading the registry under certain Trust levels).

      Note 3 When using MailBee.NET.dll for .NET 2.0 or .NET 3.5 (but not MailBee.NET.dll for .NET 4.0 and 4.5) on a 64-bit platform, make sure Visual Studio uses AnyCPU or x64 configuration of your application (in case of Mixed Platforms, examine the particular configuration for the project which uses MailBee.NET.dll). If MailBee.NET.dll is used in x86 (32-bit) project on a 64-bit system, it may be unable to find the license key in the registry. This is because 32-bit app on 64-bit Windows sees a different registry (Wow6432Node). Although SaveKeyGui and SaveKey apps may workaround this, it's not guaranteed to work in 100% of cases.

    Note 3 applies to MailBee.NET.dll for .NET 2.0 and 3.5 only (usually used with Visual Studio 2008 or earlier, .NET 2.0/3.0/3.5). Starting from .NET 4.0, CLR enables 32-bit applications to "see" 64-bit registry. Thus, MailBee.NET.dll for .NET 4.0 and .NET 4.5 can find the license key regardless of 32-bit/64-bit configuration issues. However, permission issues may still apply (such as ASP.NET restrictions mentioned above).

    This screenshot shows x86 configuration in red ("don't use me"). If for some reason you need to use x86 mode on 64-bit Windows for your application, consider upgrading to .NET 4.0+ or store the license key in both 32-bit and 64-bit registry (-rw option of SaveKey tool). Or, you can set the key in the code, app.config, or web.config file.


    Send feedback to AfterLogic

    Copyright © 2006-2023 AfterLogic Corporation. All rights reserved.