WebArchiveX.SMTPMailer - ArchiveZipAndSend Method


Builds MHT web archive and sends it by email. The method is especially useful if you need to email HTML file and all its resources (such as images or style sheets). The MHT web archive file can be attached or embedded into the body of the outgoing mail message.

IMPORTANT:  Before calling this method please make sure that all of the SMTP Server properties are correctly set.    

C++ Syntax

Show Syntax

Script Syntax

Show Syntax

ASP Sample: VB Script (without error handling)

<%@ Language=VBScript%>

<%     ' Create web archive mailer object
    Set oWAMailer = Server.CreateObject("WebArchiveX.SMTPMailer")

    ' Set default custom charset 
    oWAMailer.oWABuilder.SetCharset "windows-1255"

    ' Setting the SMTP server properties
    oWAMailer.sMAILServer = "MySMTPServerIP"
    oWAMailer.sSMTPUser = "MyServerUserName"
    oWAMailer.sSMTPPass = "MyServerPassword"
    oWAMailer.sMailSubject = "WebArchiveX MHT file"
    oWAMailer.sSenderEmail = "info@csystems.co.il"
    oWAMailer.sSenderName = "WebArchiveX Robot"
    oWAMailer.sMailRecipients = "test@csystems.co.il"

    ' Make archive and send the MHT to the E-Mail message recipients
    oWAMailer.ArchiveZipAndSend "C:\inetpub\wwwroot\test\test.html", "C:\inetpub\wwwroot\test\test.zip", True
%>

JavaScript (with error handling)

try
{
    // Create web archive mailer object
    var oWAMailer = new ActiveXObject("WebArchiveX.SMTPMailer");

    // Set default custom charset 
    oWAMailer.oWABuilder.SetCharset("windows-1255");

    ' Setting the SMTP server properties
    oWAMailer.sMAILServer = 'MySMTPServerIP';
    oWAMailer.sSMTPUser = 'MyServerUserName';
    oWAMailer.sSMTPPass = 'MyServerPassword';
    oWAMailer.sMailSubject = 'WebArchiveX MHT file';
    oWAMailer.sSenderEmail = 'info@csystems.co.il;'
    oWAMailer.sSenderName = 'WebArchiveX Robot';
    oWAMailer.sMailRecipients = 'test@csystems.co.il';

    // Make archive and write the MHT directly into Response
    oWAMailer.ArchiveZipAndSend('c:\\inetput\\wwwroot\\sample.htm', 'c:\\inetput\\wwwroot\\sample.zip',true);
}
catch(e)
{
    alert('ERROR: ' + e.description);
}

 

- WebArchiveX API - WebArchiveX Website - C Systems Website


C Systems - Creative software solutions since 1996. All rights reserved. Terms of use.