Message Property


Gets or sets the Message object which is processed by the SMIME object.


Value Type: Message object
Parameters: None 
Remarks:

When the developer passes a reference to some Message object to this property, a copy of this Message object is created and assigned to this property.

 

Thus, all subsequent operations over this object (such as encryption, decryption, signing, etc) alter this copy but not the original Message object.


Usage example:

' This example loads the message from file, encrypts and saves it to disk.

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"

' Load the message from file
objMsg.ImportFromFile "mail_src.eml"

' Specify the message for further processing
Set objSMIME.Message = objMsg

' Add the recipient's certificate which should be used for the message encryption
If objSMIME.AddRecipientCert ("AddressBook", 0, "", "", "", objMsg.PureToAddr) Then
	' Try to encrypt the message
	If objSMIME.Encrypt Then
		' Get the encrypted message from SMIME object
		Set objMsg = objSMIME.Message

		' Save the encrypted message to file
		objMsg.SaveMessage "mail_dst.eml"
	End If
End If

See Also:

Message Object


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