Reset Method


Resets the SMIME object to its default state. This method can be used to process multiple messages.


[Visual Basic]

blnResult = ObjectName.Reset

 
Parameters: None 
Return value As Boolean True if successful, False if error has occurred.  
Remarks: After using the Reset method the SMIME object should be re-initialized before using it again.

Usage example:

' This example loads 5 messages from files, encrypts and saves them to disk. Only one instance of the SMIME object is used.
Dim objSMIME, objMsg ' Using Visual Basic to create the objects Set objMsg = CreateObject("MailBee.Message") Set objSMIME = CreateObject("MailBee.SMIME") ' Using ASP to create the objects 'Set objMsg = Server.CreateObject("MailBee.Message") 'Set objSMIME = Server.CreateObject("MailBee.SMIME") ' Specify MailBee license key objSMIME.LicenseKey = "put your license key here" ' Iterate through the messages For i = 1 To 5 ' Load the message from file objMsg.ImportFromFile "mail_src" & i & ".eml" ' Specify the message for the further processing Set objSMIME.Message = objMsg ' Add the recipient's certificate for the message encryption If objSMIME.AddRecipientCert ("AddressBook", 0, "", "", "", objMsg.PureToAddr) Then ' Encrypt the message objSMIME.Encrypt End If ' Check if any errors occurred If (objSMIME.SMIMEError <> SMIME_OK) Or (objSMIME.SMIMESpecificError <> SMIME_OK) Then ' Display the code of the last occurred error ' In ASP use Response.Write instead of MsgBox MsgBox "SMIMEError = " & objSMIME.SMIMEError & " SMIMESpecificError = " & _ objSMIME.SMIMESpecificError End If ' Get the encrypted message from the SMIME object Set objMsg = objSMIME.Message ' Save the encrypted message to disk objMsg.SaveMessage "mail_dst" & i &".eml" ' Reset the SMIME object objSMIME.Reset Next

See Also:

SMIME Object


Copyright © 2002-2022, AfterLogic Corporation. All rights reserved.