Solved

Could not access 'CDO.Message' object

Posted on 2006-06-13
6
1,000 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
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
How do I get the unique ID after insert? 87 92
The Using statement in C# 5 37
Wpf develop 5 35
Showdialog 8 21
Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

743 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now