Solved

Could not access 'CDO.Message' object

Posted on 2006-06-13
6
1,008 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
Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

 
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

Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Object Oriented Programming, C#, referencing, scoping. 13 86
API v SOA 8 42
ModalPopup  question 22 39
Header Font Size in Grid View 6 27
IP addresses can be stored in a database in any of several ways.  These ways may vary based on the volume of the data.  I was dealing with quite a large amount of data for user authentication purpose, and needed a way to minimize the storage.   …
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

730 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