Mail Problem

P

Peter

MailMessage aMessage = new MailMessage();
aMessage.From = "(e-mail address removed)";
aMessage.To = "(e-mail address removed)";
aMessage.Cc = "";
aMessage.Bcc = "";
aMessage.Subject = "Test";
aMessage.Body = "Message";
SmtpMail.SmtpServer = "smtp.server.com";
SmtpMail.Send(aMessage);

I am getting the following error, but only on one Win2K computer, the same code works on other Win2K and XP machines. I have looked on internet and other people have the same problem, but no one has the solution.

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Runtime.InteropServices.COMException (0x80029C4A): Error loading type library/DLL.
--- End of inner exception stack trace ---
at System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture, String[] namedParameters)
at System.RuntimeType.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParameters)
at System.Web.Mail.CdoSysHelper.Send(MailMessage message)
at System.Web.Mail.SmtpMail.Send(MailMessage message)


Thanks


Peter
 
N

Nicholas Paldino [.NET/C# MVP]

Peter,

Do you have CDO or CDONT installed on that machine? It is required to use the classes in the System.Web.Mail namespace.

You might want to check out the System.Net.Mail namespace in .NET 2.0, if you are able to, as I believe that dependency is not there.

Or, you can check out the Indy Project, which has .NET classes for sending mail (as well as a gazillion other things).

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

MailMessage aMessage = new MailMessage();
aMessage.From = "(e-mail address removed)";
aMessage.To = "(e-mail address removed)";
aMessage.Cc = "";
aMessage.Bcc = "";
aMessage.Subject = "Test";
aMessage.Body = "Message";
SmtpMail.SmtpServer = "smtp.server.com";
SmtpMail.Send(aMessage);

I am getting the following error, but only on one Win2K computer, the same code works on other Win2K and XP machines. I have looked on internet and other people have the same problem, but no one has the solution.

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Runtime.InteropServices.COMException (0x80029C4A): Error loading type library/DLL.
--- End of inner exception stack trace ---
at System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture, String[] namedParameters)
at System.RuntimeType.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParameters)
at System.Web.Mail.CdoSysHelper.Send(MailMessage message)
at System.Web.Mail.SmtpMail.Send(MailMessage message)


Thanks


Peter
 
P

Peter

Thank you

Indy Project works just fine.
Peter,

Do you have CDO or CDONT installed on that machine? It is required to use the classes in the System.Web.Mail namespace.

You might want to check out the System.Net.Mail namespace in .NET 2.0, if you are able to, as I believe that dependency is not there.

Or, you can check out the Indy Project, which has .NET classes for sending mail (as well as a gazillion other things).

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

MailMessage aMessage = new MailMessage();
aMessage.From = "(e-mail address removed)";
aMessage.To = "(e-mail address removed)";
aMessage.Cc = "";
aMessage.Bcc = "";
aMessage.Subject = "Test";
aMessage.Body = "Message";
SmtpMail.SmtpServer = "smtp.server.com";
SmtpMail.Send(aMessage);

I am getting the following error, but only on one Win2K computer, the same code works on other Win2K and XP machines. I have looked on internet and other people have the same problem, but no one has the solution.

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Runtime.InteropServices.COMException (0x80029C4A): Error loading type library/DLL.
--- End of inner exception stack trace ---
at System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture, String[] namedParameters)
at System.RuntimeType.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParameters)
at System.Web.Mail.CdoSysHelper.Send(MailMessage message)
at System.Web.Mail.SmtpMail.Send(MailMessage message)


Thanks


Peter
 
K

Kevin Yu [MSFT]

Hi Peter,

I agree with Nicholas that from the error message, it seems that CDO was
not installed properly on this machine. Have you installed Outlook on the
machine before?

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
 
K

Kevin Yu [MSFT]

Hi Peter,

In this case, you have to install Outlook first. Because CDO is included in
Outlook.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top