Solved

Could not access 'CDO.Message' object

Posted on 2006-06-13
6
1,011 Views
Last Modified: 2009-07-29
Our production web server hosts several web sites that send mail all using the same code.. on some of these sites the mail is sent successfully however others give the following message:

Could not access 'CDO.Message' object

This site was sending mail ok.  The only thing I think we have changed is some new users and also re-configured the application pool.  

What could be causing this error on some of these sites ????

Thanks in advance
0
Comment
Question by:mkeegan
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 

Expert Comment

by:efamilia
ID: 16893866
Sounds like a relay issue on your smtp server. If you're using 'localhost' as your smtp, try setting the stmpserver to the actual name of the machine. Also, open the smtp properties tab on IIS and make sure you're allow to relay freely.
0
 
LVL 25

Expert Comment

by:dstanley9
ID: 16894477
Generally you need to look at the InnerException when you get a "Could not access 'CDO.Message' object" error.  This is the generic COM error, and the InnerException should have more detail that may pinpoint what the problem is.
0
 

Author Comment

by:mkeegan
ID: 16900240
Today I created a test email app on the server and this worked fine.  The code is the same as the failing app.  It also uses Integration Security and the same application pool.

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim mail As New MailMessage
        mail.From = ""
        mail.To = ""
        mail.Subject = "Test Email"
        mail.Body = "This is only a test email"
        mail.BodyFormat = MailFormat.Html
        Try
            SmtpMail.Send(mail)
        Catch ex As Exception
            Label1.Text = ex.InnerException.ToString
        Finally
            Label1.Text = "email sent successfully"
        End Try

    End Sub

Notice that at this stage I am not using specifying a smtp server.  Does this matter?  Our environent is Load Balanced between 2 servers.  Each server has 2 network cards, 1 with an internal address and the other with an External Address.  Maybe this has something to do with it??  What configuration should I have in a Load Balanced environment.  

The InnerException is:

System.Web.Mail.LateBoundAccessHelper.CallMethod(Object obj, String methodName, Object[] args) at System.Web.Mail.CdoSysHelper.Send(MailMessage message) at System.Web.Mail.SmtpMail.Send(MailMessage message) at CAT_Annuity.Global.Application_Error(Object sender, EventArgs e)

0
Containers and Docker for Everyone

Containers are an incredibly powerful technology that can provide you and/or your engineering team with huge productivity gains. Using containers, you can deploy, back up, replicate, and move apps and their dependencies quickly and easily.

 
LVL 25

Accepted Solution

by:
dstanley9 earned 250 total points
ID: 16902515
If you do not specify an SMTP server it will use the local STMP service if it is running.  If you are using an external SMTP server, it could be permissions, it could be relaying, it could be a lot of things.  The InnerException should give you more detail.

0
 

Author Comment

by:mkeegan
ID: 16917630
I've been having a play with the swapping the Application Pool.  

An Application pool that achieves a Successful email send and receive results in the following being logged:
2006-06-16 01:34:00 1.1.1.1 OutboundConnectionCommand SMTPSVC1 SERVER1 - 25 EHLO - server1.DOG.local 0 0 4 0 93 SMTP - - - -

Where 1.1.1.1 is our exchange server and SERVER1 is the name of our server.  DOG is the name of our domain.

Then I switched the Application Pool to be the same as our failing Application and this message is logged.

Failed to send
2006-06-16 02:09:09 127.0.0.1 server1 SMTPSVC1 SERVER1 127.0.0.1 0 HELO - +server1 250 0 42 13 16 SMTP - - - -

Both are being sent from the same address.  The failing send is using the localhost to send.. why would this be?
Both Application Pools use a different w3 process.. what do I need to get this working?
0
 
LVL 25

Expert Comment

by:dstanley9
ID: 16920172
Are the pools running under different identities?  It could be using the mail profile of the account it's running as.  Can you specify the SMTP server in the code?  Are there any access or relay restrictions on the SMTP server on Server1?
0

Featured Post

MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A basic question.. “What is the Garbage Collector?” The usual answer given back: “Garbage collector is a background thread run by the CLR for freeing up the memory space used by the objects which are no longer used by the program.” I wondered …
This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …

729 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question