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
HRESULT ArchiveZipAndSend(
BSTR bstrHtmlFile,
BSTR bstrZipMhtFile,
BOOL bIsAttachment
);
Parameters
- bstrHtmlFilePath
- [in] BSTR - path to the input HTML file.
-
- bstrZipMhtFile
- [in] BSTR - output compressed MHT file (with extension
.zip).
bIsAttachment
[in] BOOL - Is the MHT file created will be attached to the outgoing mail message.
Return value
Returns S_OK if successful, or an error value otherwise.
Script Syntax
Show Syntax
Boolean ArchiveZipAndSend(
String htmlFilePath,
String bstrZipMhtFile,
Boolean bIsAttachment
);
Parameters
- bstrHtmlFilePath
- [in] String - path to the input HTML file.
- bstrZipMhtFile
- [in] String - output compressed MHT file (with extension
.zip).
- bIsAttachment
- [in] Boolean - Is the MHT file created will be attached to the outgoing mail message.
ASP Sample: VB Script (without error handling)
<%@ Language=VBScript%>
<%
Set oWAMailer = Server.CreateObject("WebArchiveX.SMTPMailer")
oWAMailer.oWABuilder.SetCharset "windows-1255"
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"
oWAMailer.ArchiveZipAndSend "C:\inetpub\wwwroot\test\test.html",
"C:\inetpub\wwwroot\test\test.zip", True
%>
JavaScript (with error handling)
try
{
var oWAMailer = new ActiveXObject("WebArchiveX.SMTPMailer");
oWAMailer.oWABuilder.SetCharset("windows-1255");
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';
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.