How I can send encrypted and signed message using CDO?
Give me a code sample if possible.
I am having a problem generating an encrypted message using the
CAPICOM DLL and CDO. I am using the example article Q280391 found on
The only change I have made to the EnvelopeMessage function is that I
create a new CDO.Message object within the function, rather than
passing it in as a parameter. I have made the same modification to the
SignMessage function and had no problems; SignMessage worked exactly
as desired (my goal in both cases being to produce a .EML file that
can then be sent via Exchange or a 3rd party mail component that can
send EML files).
Dim oMsg As New CDO.Message
Dim oBodyPart1 As CDO.IBodyPart
' Set To/From/Subject
.subject = "Test - Signed Message"
.TextBody = "Just a test"
' Set up main bodypart
Set oBodyPart1 = oMsg
The line setting the urn:schemas:mailheader:content-disposition field
is causing a problem. If I comment that out, .Update will succeed,
otherwise I receive the following error:
'Fields update failed. For further information, examine the Status
of individual field objects.'
Checking the content-disposition field gives me a Status of 65544. I
cannot, however, locate a list of the error codes to see what the
If anyone has had a similar problem and/or can help I would greatly
Thanks in advance..