IceWarp COM
IceWarp ActiveX is a COM object for easy sending of email and Merak Instant Messaging messages without knowing all the communication protocols. It also gives you access to IDP routines for IDP archives manipulation. IDP (IceWarp Data Package) is data format used by Merak for storing data (backup, installation files). Now installed with Merak and ready to use immediatelly after installation.
It consists of 3 objects:
- IceWarpCOM.Mailer: 100% syntax compatible with the famous ASP Email component and offers sending emails from your web scripts using any mail server.
- IceWarpCOM.IMMessage: strictly bound to Merak IM, lets you check the status of IM users and send any IM messages.
- IceWarpCOM.IDP: IDP routines interface
All of them can be used from any programming language (ASP, PHP, CF, C++, Delphi etc.), documentation and examples included.
Features
IceWarpCOM.Mailer:
- Plain Text Messages
- HTML Messages
- Charsets specification
- Messages With Attachments
- Messages With Embedded Images
- Specifying CC, Reply-To Or Any Custom Headers
IceWarpCOM.IMMessage:
- IM Messages
- Support For Any XML Tags
- User Online-state Querying
IceWarpCOM.IDP:
- Archiving to IDP archives
- Extracting from IDP archives
Examples in PHP
Plaintext message:
<?
$com = new COM("IceWarpCOM.Mailer");
$com->RemoteHost = "smtp.mydomain.com";
$com->Helo = "mycomputer.mydomain.com";
$com->FromName = "John Doe";
$com->FromAddress = "john@mydomain.com";
$com->AddRecipient("mother@mydomain.com", "Mom");
$com->Subject = "Hi mom";
$com->BodyText = "Just wanted to let you know I have new Merak Email Server installed.". "\n\nSincerely,". "\nJohn";
if (!$com->SendMail()) echo $com->Response;
$com->Release();
$com = null;
?>
HTML message:
<?
$com = new COM("IceWarpCOM.Mailer");
$com->RemoteHost = "smtp.mydomain.com";
$com->Helo = "mycomputer.mydomain.com";
$com->FromName = "John Doe";
$com->FromAddress = "john@mydomain.com";
$com->AddRecipient("mother@mydomain.com", "Mom");
$com->Subject = "Hi mom";
$com->IsHTML = True;
$com->BodyText = "... one more thing - I can now send even HTML messages from my scripts!". "\n\nSincerely,". "\nJohn";
if (!$com->SendMail()) echo $com->Response;
$com->Release();
$com = null;
?>
Message with attachment:
<?
$com = new COM("IceWarpCOM.Mailer");
$com->RemoteHost = "smtp.mydomain.com";
$com->Helo = "mycomputer.mydomain.com";
$com->FromName = "John Doe";
$com->FromAddress = "john@mydomain.com";
$com->AddRecipient("bob@mydomain.com", "Bob Smith");
$com->Subject = "Annual report";
$com->BodyText = "Hi Bob,\n". "sending you the annual report as promised. See attachment.". "\n\nRegards,". "\nJohn";
$com->AddAttachment( "c:\\Documents and Settings\\John\\Desktop\\report.rtf");
if (!$com->SendMail()) echo $com->Response;
$com->Release();
$com = null;
?>
Message with embedded image:
<?
$com = new COM("IceWarpCOM.Mailer");
$com->RemoteHost = "localhost";
$com->Helo = "localhost";
$com->FromName = "Martin";
$com->FromAddress = "admin@localhost";
$com->AddRecipient("admin@localhost", "Lobogo :)");
$com->Subject = "COM obj test";
$com->IsHTML = "True";
$com->BodyText = "<html><head>". "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">". "</head><body><img src=\"cid:123\">". "</body></html>";
$com->AddEmbeddedImage("c:\\image.jpg", "123");
if (!$com->SendMail()) echo $com->Response;
$com->Release();
$com = null;
?>
IM message:
<?
$com = new COM("IceWarpCOM.IMMessage");
$com->MessageFrom = "john@mydomain.com";
$com->MessageTo = "bob@mydomain.com";
$com->MessageSubject = "Hey pal";
$com->MessageBody = "This IM message was sent from my web site";
if (!$com->SendMessage()) echo "Error";
$com->Release();
$com = null;
?>
(bob@mydomain.com must be on John's roaster)
IM online state check:
<?
$com = new COM("IceWarpCOM.IMMessage");
$buddy = "bob@mydomain.com";
echo $buddy . ' is ';
if (!$com->IsOnline($buddy)) echo 'NOT';
echo 'online';
$com->Release();
$com = null;
?>
IDP add to archive:
<?
$com = new COM('IceWarpCOM.IDP');
$com->AddFiles('temp.idp', 'c:\windows\temp')
$com->Release();
$com = null;
?>
(must be run by user with write access to current directory)
Examples in ASP
Plaintext message:
<%
Set Mail = Server.CreateObject( "IceWarpCOM.Mailer" )
Mail.RemoteHost = "localhost"
Mail.Helo = "localhost"
Mail.FromName = "User One"
Mail.FromAddress = "user1@merakdemo.com"
Mail.MailFrom = Mail.FromAddress
Mail.AddRecipient "user2@merakdemo.com.br", "User Two"
Com.Subject = "Test message"
Com.IsHTML = "True"
Com.BodyText = "MerakCOM objects under IIS work"
If Not Com.SendMail Then Response.Write com.Response
Set Com = Nothing
%>
IM message:
<%
'
' Note:
' sender and recipient both must have the other party
' on their roster for the message to be delivered '
Set IM = Server.CreateObject("IceWarpCOM.IMMessage")
Im.MessageFrom = "user1@merakdemo.com"
Im.MessageTo = "user2@merakdemo.com"
Im.MessageSubject = "TEST"
Im.MessageBody = "UNO DUE TRES QUATRO"
If Not Im.SendMessage Then
Response.Write "Error sendin message to " & Im.MessageTo & " "
Else Response.Write "Message Sent "
End If
If Im.IsOnline( Im.MessageTo ) Then
Response.Write Im.MessageTo & " is online "
End If
Set Im = Nothing
%>
Download
Download the software.