WebArchiveX.SMTPMailer - API


The SMTP Mailer utility object is used to create and email MHT web archive files. Use the object if you need to send HTML file and all its content encrypted or not by email. The MHT file created can be attached or embedded into the body of the outgoing mail message.

Methods

NameDescription
ArchiveAndSendBuilds MHT web archive and sends it
ArchiveEncryptAndSendBuilds MHT web archive and sends it encrypted

Properties

TypeNameDescription
StringsMAILServerSMTP Mail Server name or IP address
StringsSMTPUserSMTP Mail Server account login name
StringsSMTPPassSMTP Mail Server account password
StringsMailBodyE-Mail body: HTML or Text content
StringsMailRecipientsE-Mail Recipients seperatedby semicolon
StringsMailSubjectE-Mail subject
StringsSenderNameSender full name
StringsSenderEmailSender E-Mail address
StringsAttachmentsListAttachments files seperated by semicolon (eg: C:\a.txt;d:\b.txt)
StringsAttachmentsContentTypeAttachments content types seperated by semicolon(eg: message\rfc822;plain\text...)
BooleanbDeleteAttachmentsDelete all attachments after successful E-Mail sending
BooleanbDeleteMHTFileDelete MHT file after successful E-Mail sending
WebArchiveX.BuilderoWABuilderWebArchiveX Builder object

ASP Sample: VB Script (without error handling)

<%@ Language=VBScript%>

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

    ' Set correct Charset for the web archive
    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.ArchiveAndSend "C:\inetpub\wwwroot\test\test.html", "C:\inetpub\wwwroot\test\test.mht", True
%>

JavaScript (with error handling)

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

    //Set correct Charset for the web archive
    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.ArchiveAndSend('c:\\inetput\\wwwroot\\sample.htm', 'c:\\inetput\\wwwroot\\sample.mht',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.