Catalyst Internet Mail .NET

InternetMail.Initialize Method (String)

Initialize an instance of the InternetMail class.

[Visual Basic]
Overloads Public Function Initialize( _
   ByVal licenseKey As String _
) As Boolean
[C#]
public bool Initialize(
   string licenseKey
);

Return Value

A boolean value which specifies if the class was initialized successfully.

Remarks

The Initialize method can be used to explicitly initialize an instance of the InternetMail class, loading the networking library and allocating resources for the current thread. Typically an application would define the license key as a custom attribute, however this method can be used to initialize the class directly.

The runtime license key for your copy of SocketTools can be generated using the License Manager utility that is included with the product. Note that if you have installed an evaluation license, you will not have a runtime license key and cannot redistribute any applications which use the InternetMail class.

Example

The following example shows how to use the Initialize method to initialize an instance of the class. This example assumes that the license key string has been defined in code.

[CS]
SocketTools.InternetMail mimeClient = new SocketTools.InternetMail();
 
if (mimeClient.Initialize(strLicenseKey) == false)
{
    MessageBox.Show(mimeClient.LastErrorString, "Error",
                    MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
    return;
}
    
[Visual Basic]
Dim mimeClient As New SocketTools.InternetMail
 
If mimeClient.Initialize(strLicenseKey) = False Then
    MsgBox(mimeClient.LastErrorString, vbIconExclamation)
    Exit Sub
End If
    

See Also

InternetMail Class | SocketTools Namespace | InternetMail.Initialize Overload List | RuntimeLicenseAttribute Class | Uninitialize Method