Back to Articles List

I have a problem with sending PDFs by email.

Symptoms

When I try to use the "Send by email" function of PDF-XChange Editor an error message appears: "A problem occurred while sending the e-mail: Error [MailLib]: MAPI.DLL cannot be loaded":

MAPI DLL error mesage

Cause

There is an issue in locating the correct MAPI.DLL version for your default mail client.

There are many possible reasons for this issue. This article will not cover them all, but is intended to give an overview of how the process works in order to facilitate the resolving of the problem. MAPI.DLL is a Windows component that is often used to interface email and other applications. Each installed mail client has its own version of this DLL, which other applications must use when a call to that mail client is made. The DLL that is used depends on the result of a series of registry checks where windows looks for a defined mail client default.

When a mail client is installed in Windows it will usually ask to be registered as a mail client. During registration it creates a key in the Windows registry that defines where to find its version of the MAPI.DLL, as well as a name to identify by.  These registered mail clients are stored in sub-keys of:HKEY_LOCAL_MACHINE\SOFTWARE\Clients\Mail 

Quick Resolution

Follow the steps below to resolve this issue:

1. Ensure that all instances of PDF-XChange software and your mail clients are closed.

2. Open the Windows search, then enter 'regedit' and press Enter to launch the registry editor.

3. Enter the following string in the address bar:

Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Clients\Mail

4. Click the desired default mail client in the Mail dropdown:

​​​​​

5. ​​Double-click the (Default) value in this key. The Edit String dialog box will open. Select the text in the Value data: text box, then and press Ctrl+C to copy it to the clipboard and click OK to close the dialog box.

6. Enter the following string in the address bar:

HKEY_CURRENT_USER\SOFTWARE\Clients

There should be a Mail key in the Clients key. If a Mail key is not present then right-click the Clients key, click New > key and enter Mail (case sensitive) as the name.

7. Click the Mail key, then double-click the Default key. The Edit String dialog box will open. Select the Value data: text box and press Ctrl+V to paste the clipboard content there:

8. Click OK to close the dialog box.

The process is now complete. Please note that in some cases a system restart is required for this change to take effect.

Detailed Explanation and Resolution

This example is from a machine that has three email clients installed. The relevant keys in relation to this issue are the (Default) and DLLPath keys. (Default) defines a name that can be used in other registry locations to refer to this client, and DLLPath is the path to the MAPI.DLL version this client will use.

 registered ail clients

There are two additional keys that are used to determine the client used as the default mail client for per-machine and per-user preferences. These are:HKEY_LOCAL_MACHINE\SOFTWARE\Clients\Mail and

HKEY_CURRENT_USER\SOFTWARE\Clients\Mail respectively.

The (Default) key should have a value that matches the name of an existing mail client. An example of a per-machine default mail client setting is detailed below:

all users default mail client

The value of the (Default) key in this case is "Microsoft Outlook", and It matches the name defined for Microsoft Outlook in the Mail key of the Windows registry.

Similarly, a per-user default mail client can be set using HKEY_CURRENT_USER\SOFTWARE\Clients\Mail. As in the example above, the value of the (Default) key must match an existing mail client. An example of a per-user default mail client setting is detailed below:

per user mail default

  Note that it matches the definition in HKLM:

Postbox registration key

Summary

  • Check that your desired mail client is correctly defined and can be found as a sub key of HKEY_LOCAL_MACHINE\SOFTWARE\Clients\Mail.
  • Check that your per-machine default contains a name that matches the name defined for your mail client.
  • Check that your per-user default contains a name that matches the name defined for your mail client.
  • Note that It is preferable to have no value as a default mail client rather than an invalid value.

What happens when an application calls the default mail client to send an email?

Windows will perform the following steps:

1. Look for a User Preference

Windows will search for a (Default) key in HKEY_CURRENT_USER\SOFTWARE\Clients\Mail and read its value. 

- If this value matches a definition name as defined in HKLM (as detailed above), then it will use the matching MAPI.DLL version and launch the 'Compose Email' window for that mail client.
- If this value does not match any definition name as defined in HKLM then it will cause the error detailed above.
- If this value is empty then Windows will search for a per-machine preference in HKEY_LOCAL_MACHINE\SOFTWARE\Clients\Mail.

2. Look for a Machine Preference

Windows will search for a (Default) key in HKEY_LOCAL_MACHINE\SOFTWARE\Clients\Mail and read its value.

- If this value matches a definition name as defined in HKLM (as detailed above) then it will use the matching MAPI.DLL version and launch the 'Compose Email' window for that mail client.
- If this value does not match any definition name as defined in HKLM then it will cause the error detailed above.
- If this value is empty then Windows will attempt to set default values.

3. Load the Windows Defaults

If no default value is found that matches any of the definitions in HKEY_LOCAL_MACHINE\SOFTWARE\Clients\Mail then Windows will select defaults to use.

Was this article helpful?
Yes No Somewhat