E
Eric van Wijk
Hi All,
After installing SP1 for Windows 2003, I'm running into the 'Error
loading type library/DLL' exception when using CDO through System.Web.Mail:
-------------------------------------------
//try {
// security assertion
SecurityPermission interopPermission = new
SecurityPermission(SecurityPermissionFlag.UnmanagedCode);
interopPermission.Demand();
MailMessage mail = new MailMessage();
if (ConfigurationSettings.AppSettings["smtpServer"] != null) {
SmtpMail.SmtpServer =
ConfigurationSettings.AppSettings["smtpServer"];
//SmtpMail.SmtpServer.Insert(0,
ConfigurationSettings.AppSettings["smtpServer"]);
}
mail.From = ConfigurationSettings.AppSettings["from"];
mail.To = ConfigurationSettings.AppSettings["to"];
mail.Subject = "ASP.NET CDO Test";
mail.BodyFormat = MailFormat.Text;
mail.Body = message.ToString();
SmtpMail.Send(mail);
/*
} catch (Exception e) {
Exception innerException = e;
do {
if (innerException is FileNotFoundException) {
FileNotFoundException fileException =
(FileNotFoundException)innerException;
Trace.Warn(innerException.GetType().FullName,fileException.FileName,innerException);
} else {
Trace.Warn(innerException.GetType().FullName,String.Empty,innerException);
}
innerException = innerException.InnerException;
} while (innerException != null);
}
*/
-------------------------------------------
The code runs fine on Windows XP and another Windows 2003 Server which
has had SP1 installed about a month ago.
What I've already tried:
- Mailing from VBScript using CDO directly: works, so CDO must installed
correctly
- Running the same code from a console app: works, so System.Web.Mail
must be installed correctly
- The sugestions from http://www.systemwebmail.com/faq/4.2.1.aspx: do
NOT work
Any help would be greatly welcomed, as I've been baning my head on this
for more than a day now.
Thx in adv.
Eric
After installing SP1 for Windows 2003, I'm running into the 'Error
loading type library/DLL' exception when using CDO through System.Web.Mail:
-------------------------------------------
//try {
// security assertion
SecurityPermission interopPermission = new
SecurityPermission(SecurityPermissionFlag.UnmanagedCode);
interopPermission.Demand();
MailMessage mail = new MailMessage();
if (ConfigurationSettings.AppSettings["smtpServer"] != null) {
SmtpMail.SmtpServer =
ConfigurationSettings.AppSettings["smtpServer"];
//SmtpMail.SmtpServer.Insert(0,
ConfigurationSettings.AppSettings["smtpServer"]);
}
mail.From = ConfigurationSettings.AppSettings["from"];
mail.To = ConfigurationSettings.AppSettings["to"];
mail.Subject = "ASP.NET CDO Test";
mail.BodyFormat = MailFormat.Text;
mail.Body = message.ToString();
SmtpMail.Send(mail);
/*
} catch (Exception e) {
Exception innerException = e;
do {
if (innerException is FileNotFoundException) {
FileNotFoundException fileException =
(FileNotFoundException)innerException;
Trace.Warn(innerException.GetType().FullName,fileException.FileName,innerException);
} else {
Trace.Warn(innerException.GetType().FullName,String.Empty,innerException);
}
innerException = innerException.InnerException;
} while (innerException != null);
}
*/
-------------------------------------------
The code runs fine on Windows XP and another Windows 2003 Server which
has had SP1 installed about a month ago.
What I've already tried:
- Mailing from VBScript using CDO directly: works, so CDO must installed
correctly
- Running the same code from a console app: works, so System.Web.Mail
must be installed correctly
- The sugestions from http://www.systemwebmail.com/faq/4.2.1.aspx: do
NOT work
Any help would be greatly welcomed, as I've been baning my head on this
for more than a day now.
Thx in adv.
Eric