Solved

Could not access 'CDO.Message' object

Posted on 2006-06-13
6
1,005 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
  • 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
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 
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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

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 …
In my previous article (http://www.experts-exchange.com/Programming/Languages/.NET/.NET_Framework_3.x/A_4362-Serialization-in-NET-1.html) we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

776 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