Problem Using CAPICOM, CDOSYS and EXCEL Interop wi
1. If the attachment is an Excel file (zipped or
unzipped) generated in the app and is sent as secure mail
(S/MIME PKCS#7 encryption), the mail cannot be opened in
outlook - it says, "Your Digital Id can not be found by
the underlying security system". Works fine if the
attachment is a text file (zipped or unzipped).
2. When using CDO, the file(s) used as attachment are
locked and are not available for exclusive access (to be
is used to release the CDO object used, then any
subsequent call to .NET MailMessage object fails saying
NULL reference to CDO.
1. The application generates result files in Excel or
2. If output option is "compress", then the file(s) are
zipped up and the result file(s) are deleted.
3. If the mailing option is "non-secure", then it uses
standard .NET mailing and sends the file(s) as attachment.
4. If the mailing option is "secure" and we have a
digital id of the recipient available, then:
a. A CDO Message is created and the file(s) are attached
b. The message is encrypted (using CAPICOM) S/MIME
(PKCS#7) format and sent out.
5. The file(s) used as attachment(s) are deleted.
The application is written in C# and compiled under .NET v
1.1 and runs as a Windows Service on a Windows 2003 /
Windows 2000 server.
..NET framework assemblies:
Custom .NET libraries
Microsoft.ApplicationBlocks.Data.dll (v 2)
ICSharpCode.SharpZipLib (a ICSharpCOde open source
ICSharpCode.SharpZipLib.Zip (a ICSharpCOde open source
NullableTypes (a sourceforge.net open source project)
COM through Interop:
Excel 11 (2003)
CDO for Windows 2000
CAPICOM 22.214.171.124 (I had to change a few calls in the
typelib to make it work with .NET)
WaitFor.DLL (from Serverobjects.com - waits till you get
exclusive access to a file)