WebArchiveX.SMTPMailer - ArchiveEncryptAndSend Method
ArchiveEncryptAndSend build MHT web archive and send it encrypted to a specified
email address.
The method is especially useful if you need to send HTML file and all it's content as encrypted file
to the client mailbox. The MHT file created can be decrypted using the WebArchiveX Encoder/Decoder.
IMPORTANT: Before calling this method
please make sure that all of the SMTP Server properties are correctly set.
C++ Syntax
Show Syntax
HRESULT ArchiveEncryptAndSend(
BSTR bstrHtmlFile,
BSTR bstrMhtFile,
BSTR bstrPassword
);
Parameters
- bstrHtmlFilePath
- [in] BSTR - path to the input HTML file.
- bstrMhtFile
- [in] BSTR - output MHT file.
- bstrPassword
- [in] BSTR - Password to encrypt the MHT file (same password should be used to decrypt the MHT file).
Return value
Returns S_OK if successful, or an error value otherwise.
Script Syntax
Show Syntax
Boolean ArchiveEncryptAndSend(
String htmlFilePath,
String bstrMhtFile,
String bstrPassword
);
Parameters
- bstrHtmlFilePath
- [in] String - path to the input HTML file.
-
- bstrMhtFile
- [in] String - output MHT file.
bstrPassword
[in] String - Password to encrypt the MHT file (same password should be used to decrypt the MHT file).
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.ArchiveEncryptAndSend "C:\inetpub\wwwroot\test\test.html", "C:\inetpub\wwwroot\test\test.mht", "CsystemsPassword"
%>
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.ArchiveEncryptAndSend('c:\\inetput\\wwwroot\\sample.htm', 'c:\\inetput\\wwwroot\\sample.mht','CsystemsPassword');
}
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.