Quicklinks
ActiveEmail SMTP/POP3 Toolkit is a software development kit (SDK) that enables the user to send (SMTP) and receive (POP3) e-mail messages. ActiveEmail 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 and many more), different encodings (including 7/8 bit, quoted-printable, base64).
ActiveEmail can be well integrated into HTML/Javascript environments. This document describes how ActiveEmail can be integrated into HTML/Javascript projects.
When using HTML, there are two ways to install ActiveEmail on a client PC:
You can install the ActiveEmail automatically using the following HTML code on top of the HTML page:
<head>
<object id="objSmtpServer"
codeBase="http://www.activexperts.com/files/activemail/aemail.dll"
height="30" width="200"
classid="CLSID:40EE3068-9ADF-4C7E-ACC0-B11307F2F69A" viewastext>
</object>
<object id="objSmtpMail"
codeBase="http://www.activexperts.com/files/activemail/aemail.dll"
height="30" width="200"
classid="CLSID:AB4AD6DF-DABE-45C9-8E45-2909E7C2EAA9" viewastext>
</object>
</head>
The ActiveEmail component will be installated automatically. The user will be asked to confirm the installation, because the DLL is coming from an untrusted site (www.activexperts.com).
There are two ways to avoid prompting:
On each client PC, download the ActiveEmail SMTP/POP3 Toolkit from the ActiveXperts Download Site and start the installation. The installation guides you through the installation process.
You must use Javascript to declare and create the ActiveEmail objects.
Use the following Javascript code to declare and create the SMTP objects:
var objSmtpServer; var objSmtpMail; objSmtpServer = new ActiveXObject ( "ActiveXperts.SmtpServer" ); objSmtpMail = new ActiveXObject ( "ActiveXperts.SmtpMail" );
Use the following Javascript code to declare and create the POP3 objects:
var objPop3Server; var objPop3Mail; objPop3Server = new ActiveXObject ( "ActiveXperts.SmtpServer" ); ' NOTE: do NOT create the Pop3Mail object, because it is ' created by the Pop3Server object when a new message is received
Insert the following lines to declare and create the constants object:
var objConstants; objConstants = new ActiveXObject ( "ActiveXperts.EMailConstants" );
You can now send and/or receive e-mail messages.
The following HTML code shows how to send an e-mail:
<html>
<head>
<META HTTP-EQUIV="CONTENT-Type" CONTENT="text/html;CHARSET=utf-8" >
<title>ActiveEmail HTML Sample</title>
</head>
<body>
<script language="JavaScript">
function Send ()
{
var objSmtpMail;
var objSmtpServer;
objSmtpMail = new ActiveXObject ( "ActiveXperts.SmtpMail" );
objSmtpServer = new ActiveXObject ( "ActiveXperts.SmtpServer" );
objSmtpMail.Clear();
objSmtpServer.Clear();
objSmtpMail.FromAddress = textFrom.value;
objSmtpMail.AddTo( textTo.value, "" );
objSmtpMail.AddCC( textCC.value, "" );
objSmtpMail.AddBCC( textBCC.value, "" );
objSmtpMail.Subject = textSubject.value;
objSmtpMail.Body = textMessage.value;
objSmtpServer.Connect( textServer.value )
textResult.value = objSmtpMail.sysRecipientsTo;
if( objSmtpServer.LastError == 0 )
{
objSmtpServer.Send ( objSmtpMail )
}
textResult.value = "ERROR " + objSmtpServer.LastError;
objSmtpServer.Disconnect ();
}
</script>
<font face="sans-serif" size="2">
<hr size="1" color="#707070">
<font size="4">ActiveXperts ActiveEmail HTML Sample</font>
<br>
<br>
<b>Send an email message to a recipient using SMTP.</b>
<br>
<br>
<hr size="1" color="#707070">
<br>
<table border="0" bgcolor="#f0f0f0" ID="Table1">
<tr>
</tr>
<tr>
<td valign="top">SMTP Server:</td>
<td>
<input size="70" type="text" name="textServer" value="<IP address or hostname>"><br>
</td>
</tr>
<tr>
<td valign="top">E-mail from:</td>
<td>
<input size="70" type="text" name="textFrom" value=""><br>
</td>
</tr>
<tr>
<td valign="top">E-mail to:</td>
<td>
<input size="70" type="text" name="textTo" value=""><br>
</td>
</tr>
<tr>
</tr>
<tr>
<td valign="top">E-mail CC:</td>
<td>
<input size="70" type="text" name="textCC" value=""><br>
</td>
</tr>
<tr>
</tr>
<tr>
<td valign="top">E-mail BCC:</td>
<td>
<input size="70" type="text" name="textBCC" value=""><br>
</td>
</tr>
<tr>
</tr>
<tr>
<td valign="top">Subject:</td>
<td>
<input size="70" type="text" name="textSubject" value=""><br>
</td>
</tr>
<tr>
</tr>
<tr>
<td valign="top">Message:<br></td>
<td>
<textarea rows="3" name="textMessage" cols="77">Hello, world</textarea>
</td>
</tr>
<tr>
<td vAlign="top">Result:</td>
<td>
<input size="100" type="text" name="textResult"></input>
</td>
</tr>
</table>
<br>
<input type="button" onclick="Send()" value="Send Message">
<br>
</body>
</html>
There are many working samples included with the product. You can also find them on the ActiveXperts FTP site: ftp.activexperts-labs.com/samples/aemail.