SMIMEError Property


Gets the code of the last occurred SMIME error.


Value Type: Long
Parameters: None 
Remarks:

MailBee supports the following error codes:

  • SMIME_OK = 0 - no SMIME errors occurred
  • SMIME_INVALID_SIGNATURE = 41 - the message has incorrect digital signature
  • SMIME_STORE_NOT_FOUND = 42 - the specified certificate's storage was not found
  • SMIME_ENCRYPTION_FAILED = 43 - the encryption of the message has failed
  • SMIME_DECRYPTION_FAILED = 44 - the decryption of the message has failed
  • SMIME_SIGN_FAILED = 45 - the signing of the message has failed
  • SMIME_WRONG_PASSWORD = 46 - the wrong password was specified to access the PFX certificate's storage OR FromAddr does not match the e-mail address in the certificate (if latter, SMIMESpecificError would be 86)
  • SMIME_CERT_NOT_FOUND = 47 - the digital certificate was not found
  • SMIME_ERR_NOT_LICENSED = 48 - the specified license key is invalid
  • SMIME_ERR_SPECIFIC = 49 - the specific SMIME error has occurred.

The developer can get the code of the last occurred specific SMIME error using the SMIMESpecificError property.


Usage example:

' This example loads the message from file and tries to add the recipient's certificate to the storage.
' If the adding fails, the code of the occurred SMIME error is displayed.

Dim objMsg, objSMIME

' 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 = 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 the further processing
Set objSMIME.Message = objMsg

' Add the recipient's certificate to the storage
objSMIME.AddRecipientCert "AddressBook", 0, "", "", "", objMsg.PureToAddr

' Display the code of the occurred SMIME error
' In ASP use Response.Write instead of MsgBox
MsgBox objSMIME.SMIMEError

See Also:

SMIMESpecificError Property


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