ActiveXperts Email Component


ActiveXperts Email Component is a software development kit (SDK) that enables the user to send (SMTP) and receive (POP3) e-mail messages. ActiveXperts Email Component supports SMTP, POP3, multiple recipients (To, CC, BCC), multiple attachments (ASCII and binary), rich text body formats (RTF/HTML), Unicode, multiple character sets, SMTP authorization (AUTH PLAIN, AUTH LOGIN, AUTH CRAM MD5), POP3 authorization (Plain, APOP), POP3 header download, different character sets (including arabic, chinese, japanese, russian, greek, hebrew and many more), different encodings (including 7/8 bit, quoted-printable, base64).


This document describes how ActiveXperts Email Component can be integrated into HTML projects. This demo project will ask the user to give an e-mail address and a password on the command prompt, then it will download e-mails from a POP3 server.

Step 1: Installation of ActiveXperts Email Component

When using HTML, there are two ways to install ActiveXperts Email Component on a client PC:

  • Automatically using HTML code;
  • Using the ActiveXperts Email Component InstallShield installation.

Automatic installation using HTML code

You can install the ActiveXperts Email Component automatically using the following HTML code on top of the HTML page:

<object codebase="" 
         classid="CLSID:1A129FBB-C9B4-43F7-8352-30CEF860AD8A" ></object>

The Email Component will be installated automatically. The user will be asked to confirm the installation, because the DLL is coming from an untrusted site ( There are two ways to avoid prompting:

  • Add the ActiveX/COM location to the user's trusted sites. You can manage trusted manually (by using the Internet Explorer), through a logon script (by appyling the registry change from the logon script) or by using Active Directory Group Policies;
  • Or use a trusted location for the DLL. For instance your Intranet site, because most probably this site has already been added to the list of trusted sites for all users.

Manual installation using ActiveXperts Email Component installation procedure

On each client PC, download the ActiveXperts Email Component from the ActiveXperts Download Site and start the installation. The installation guides you through the installation process.

Step 2: Create the E-mail objects in HTML

You must use Javascript to declare and create the objects.

Use the following Javascript code to declare and create the 'objPop3' object:

var objPop3 = new ActiveXObject("AxEmail.Pop3");

Step 3: Receive E-mail messages

You can now receive E-mail messages.

The following code will download all messages from the POP3 server:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 

<html xmlns="" >
  <title>ActiveXperts Email Component Javascript Demo</title>
  <link rel="Stylesheet" type="text/css" href="css/Layout.css" />
  <object codebase="" 
  classid="CLSID:1A129FBB-C9B4-43F7-8352-30CEF860AD8A" ></object>
  <script language="JavaScript" type="text/javascript">
    var objPop3 = new ActiveXObject("AxEmail.Pop3");
    var fso = new ActiveXObject("Scripting.FileSystemObject");
    objPop3.LogFile = fso.GetSpecialFolder(2) + "\\AxEmail.Pop3.log";
    // Windows default: 'C:\Users\%USERNAME%\AppData\Local\Temp\AxEmail.Pop3.log'
    window.attachEvent("onload", PageLoaded, false);
    function PageLoaded() {
      document.getElementById("APIinfo").innerHTML = "Build: " + objPop3.Build + 
                                  "; Module: " + objPop3.Module;
      var objForm = document.forms["Pop3SampleForm"]
      objForm.txtLogfile.value = fso.GetSpecialFolder(2) + "\\AxEmail.Pop3.log";
      objForm.txtResult.value = "n/a";
    function ListMessages() {
      var objEmailConstants = new ActiveXObject("AxEmail.Constants");
      var objEmail = new ActiveXObject("AxEmail.Message");
      objPop3.Authentication = objEmailConstants.POP3_AUTH_AUTO;
      var objForm = document.forms["Pop3SampleForm"];
      //Clear all previous results
      for (i = objForm.lvMessages.length - 1; i >= 0; i--) {
      if (objForm.cbxSecure.checked == 1)
        objPop3.SetSecure(995); // 995 is the default secure POP3 port
      if (objPop3.LastError == 0)
      if (objPop3.LastError == 0) 
        var numMessages = objPop3.CountMessages();
      if (objPop3.LastError == 0) 
        for (var i = 1; i <= numMessages; i++) {
          objEmail = objPop3.GetEmailHeader(i);
          if (objPop3.LastError == 0) {
            var NewOption = document.createElement('option');
            NewOption.text = objEmail.Date + ": " + objEmail.FromAddress + 
                              "; Subject" + objEmail.Subject;

    function UpdateResult(objForm) {
      objForm.txtResult.value = objPop3.LastError;
  <div class="ax_maincontainer">
    <div class="ax_header">
      <div class="ax_stroke"></div>
      <div class="ax_logo"></div>
    </div><!-- /header -->
    <div class="ax_menu">
      | <a href="index.html">Home</a>      
      | <a href="smtp.html">SMTP</a>
      | <a href="pop3.html">POP3</a> |
    </div><!-- /menu -->
    <div class="ax_container">
      <h1>ActiveXperts Email Component Javascript POP3 Sample</h1>
      <hr />
        Simple Mail Transfer Protocol (SMTP) is an Internet standard for electronic mail (e-mail) 
        transmission across Internet Protocol (IP) networks.
        SMTP is specified for outgoing mail transport and uses TCP port 25 by default.
      <form name="Pop3SampleForm" action="pop3.html" method="post">
        <h2>ActiveXperts Email Component:</h2>
        <h3 id="APIinfo"></h3>
        <!-- Host, Secure -->
        <label for="Host">Mailserver:</label>
          <input type="text" id="Host" name="txtHost" value="" />
          <input type="checkbox" class="ax_cbFix" id="Secure" name="cbxSecure" value="1" />
          <label for="Secure">Secure</label>
        <!-- Account -->
        <label for="Account">Account:</label>
          <input type="text" id="Account" name="txtAccount" value="" />
        <!-- Password -->
        <label for="Password">Password:</label>
          <input type="password" id="Password" name="txtPassword" value="" />
        <!-- Empty row -->
        <div class="ax_clearRow"></div>
        <!-- List Messages button -->
        <div class="ax_clearLabel"></div>
          <input type="button" name="btnSendMessage" onclick="ListMessages()" 
              value="List Messages" />
        <!-- Messages Listbox -->
        <label for="Received">Messages received:</label>
          <select id="Received" name="lvMessages" class="ax_FullWidth" size="10"></select>
        <!-- Result -->
        <label for="Result" class="ax_Bold">Result:</label>
          <input type="text" id="Result" name="txtResult" class="ax_FullWidth Bold" />
        <!-- Logfile -->
        <label for="Logfile">Logfile:</label>
          <input type="text" id="Logfile" name="txtLogfile" class="ax_FullWidth" />
        This demo uses the ActiveXperts ActiveXperts Email Component, an 
        <a href="" target="_blank">ActiveXperts Software</a> 
        product.<br />
         <a href="index.html">Back to main page</a>
    </div><!-- /container -->
    <div class="ax_footer">
      <div class="ax_icon"></div>
        © 2011 <a href="" target="_blank">
        Active<font color="#CCC000000">X</font>perts Software B.V.</a> All rights reserved.
  <a href=""       target="_blank">Contact Us</a> |
  <a href=""    target="_blank">Terms of Use</a> |
  <a href="" target="_blank">Privacy Policy</a>
    </div><!-- /footer -->
  </div><!-- /maincontainer -->

You can download the full source code of this project from the ActiveXperts FTP site: There are many other working samples included with the product or on the FTP site.

NOTE: Demo Projects are created with Microsoft Visual Studio 2008

The ActiveXperts Email Component project ships with a set of Microsoft Visual Studio .NET samples. The projects are created with Microsoft Visual Studio 2008.

Users with a later version of Microsoft Visual Studio can open such a project. The Visual Studio Conversion Wizard will guide you through the process of converting the project to the version used.