Error loading type library/DLL.
This is usually permissions or a corruption/not-installed problem.
To check permissions, here are a few suggestions to try. While trying these suggestions, you may want to try the most liberal settings, until it works, and then tighten the settings down to make sure your server is secure.
Add the ASPNET account to the administrators group. Now don't get freaked out on this suggestion.
It's only a test. If you add the ASPNET account to the administrators group, and the exception goes away, then you KNOW it was a permissions error,
and you can work from there. Just be sure to remove the ASPNET account FROM the administrators group, so you don't have a security hole in your server.
Locate the "Common Files" folder, typically at c:\program files\common files\. Grant the ASPNET account read access to that folder, and subfolders.
Try adding the [assembly:PermissionSetAttribute(SecurityAction.RequestMinimum, Name ="LocalIntranet")]
attribute to your assembly. More information on the PermissionSetAttribute attribute can be found here:
If you are using "localhost" for the SmtpMail.SmtpServer property (or if you left it blank), you may want to try the following:
Open up IIS Admin. Locate the SMTP Server, and right-click select Properties. On the Security tab, add the ASPNET account as an Operator.
Close the dialoag, and stop/start the SMTP Service. If this works, I don't know how to tell you to fix this problem. Sorry.
However, I consider this a security breach, and would recommend you purchase a 3rd party product, and not use System.Web.Mail.
Evidently there is something funky with your machine.
Open up the registry. Locate the CDOSys.dll and the CDONTS.dll. Grant full control to the ASPNET Account. If you can't
locate either of these dlls, then you probably don't have them installed on your system. You need to get them installed.
Using Windows explorer, locate the MailRoot folder ( normally found at c:\inetpub\mailroot ).
Grant the ASPNET account read/write permissions to this folder, and all subfolders.
If none of these suggestions work, you may not have the CDOSys.dll/CDONTS.dll's installed on your server,
or else they may be corrupted.
These dlls are usually installed with Outlook, Outlook Express, or Microsoft Office. The CDONTS.dll is
installed with the older NT4 Option Pack.
This knowledgebase article may be helpful
PRB: Collaboration Data Objects for Windows NT,
Collaboration Data Objects for Windows 2000, and Collaboration Data Objects for Exchange 2000 Require Outlook Express
I'm outt of suggestions. If I've missed anything, that you found works for you, please email me at
Other than that, I suggest you may want to talk your boss into buying you a copy of aspNetEmail.
Copyright © 2004 Contact: Dave Wanta.