System.Web

  • Thread starter Thread starter Bryan Martin
  • Start date Start date
B

Bryan Martin

I have a program which has ran every night fine until last night. Now it
bombs with the following errors. I have also broke this down to its
simplest form for sending the mail
(http://support.microsoft.com/default.aspx?scid=KB;EN-US;314201) which gives
the same error. This server does not have any firewall software running on
it as it is the exchange server for the domain. I can also telnet smtp and
send mail using localhost, 127.0.0.1, machinename, and mx name. I have
copied the system.web.dll from a dev machine over to the running directory
and still same error msg. Any ideas?

SIMPLE FORM
----------------------------------------------------
Could not access 'CDO.Message' object.
Exception has been thrown by the target of an invocation.
The transport failed to connect to the server.




Unhandled Exception: System.Web.HttpException: Could not access
'CDO.Message' ob
ject. ---> System.Reflection.TargetInvocationException: Exception has been
throw
n by the target of an invocation. --->
System.Runtime.InteropServices.COMExcepti
on (0x80040213): The transport failed to connect to the server.

--- 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,
Bind
er binder, Object target, Object[] args, ParameterModifier[] modifiers,
CultureI
nfo culture, String[] namedParameters)
at System.Web.Mail.LateBoundAccessHelper.CallMethod(Object obj, String
method
Name, Object[] args)
--- End of inner exception stack trace ---
at System.Web.Mail.LateBoundAccessHelper.CallMethod(Object obj, String
method
Name, Object[] args)
at System.Web.Mail.CdoSysHelper.Send(MailMessage message)
at System.Web.Mail.SmtpMail.Send(MailMessage message)
at testmail.Module1.Main()
 
Seen that article early in the troubleshooting process. As I stated before
most of the things described in the article have been tried.
 
Hi

Based on my understanding, you can send the email with your localhost, that
is to say the SMTP service is OK. And the program will run OK for a long
time until recently it broke suddently. Also it seems that you have tried
the KB314201, I assume you run the KB code in a console applicaton under
the account with administrator rights. If not, you may have a try and let
me know the result, so that we can isolate the problem.

If I have any misunderstanding, please feel free to post here.

From the MSDN,

The System.Web.Mail namespace contains classes that enable you to construct
and send messages using the CDOSYS (Collaboration Data Objects for Windows
2000) message component. The mail message is delivered either through the
SMTP mail service built into Microsoft Windows 2000 or through an arbitrary
SMTP server. The classes in this namespace can be used from ASP.NET or from
any managed application.

That is to say the System.Web.Mail is the wrap for the CDOSYS.dll which is
located in the path below.
c:\WINDOWS\system32\cdosys.dll

From the error mesage, it seems that it has some error when the
System.Web.Mail call the cdosys.dll, or the cdosys.dll call the smtp
service.

To troubleshooting the problem, we may tried the following.
1. Try to move the code line below, so that the mail will be sent via the
localhost(please make sure first the local SMTP service will work)
SmtpMail.SmtpServer = "MySMTPServer"
2. Tried to run the code under administrators account in a console
application in case you have not done that.


Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 
To add insult to injury. This appears to be something between the dotnet
framework and exchange. I can change the smtpserver to an offsite smtp
server and the error goes away. I can telnet locally using 127.0.0.1,
hostname, mx name etc with success and no errors and no clients are
reporting errors sending mail. Server has been rebooted several times.
Still at a loss.
 
Hi

Based on my understanding, now you can send the mail by using
System.Web.Mail via the local SMTP service.
If I have any misunderstanding, please feel free to let me know.

If so, I think the problem is isloate to the problem that how to configure
in Exchange site so that we can send mail via the remote exchange server.
Because if we can send the mail via the local server, I think the code, the
System.Web.Mail and the CDOSYS.dll should be OK(one of these has corrupt
will cause the mail send failed)

So far I think you may try to send the mail by using the local smtp
client,(e.g. Outlook express to send the email via the remote the
exchange,NOTE: I don't mean the microsoft outlook(they connect to the
exchange server use other approach than the smtp)

Also for exchange configurate issue, I think you may try to post in the
newsgroup below.
microsoft.public.exchange
or
microsoft.public.exchange2000

Thanks for your understanding!

Best regards,

Perter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
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

Back
Top