Solved

Could not access 'CDO.Message' object

Posted on 2006-06-13
6
1,006 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
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

The object model of .Net can be overwhelming at times – so overwhelming that quite trivial tasks often take hours of research. In this case, the task at hand was to populate the datagrid from SQL Server database in Visual Studio 2008 Windows applica…
This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

791 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