Could not access 'CDO.Message' object

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Thys Brits

    #1

    Could not access 'CDO.Message' object

    Hi,

    I'm using the System.Web.Mail class to send an e-mail from my ASP.Net
    application, but when sending the e-mail, I'm getting the above error. It
    seems to be because I have Office XP installed, and the version of CDO is
    replaced by this installation. I haven't been able to find this error
    anywhere on any MS site. Anyone have a clue on how to then actually send the
    e-mail?

    Thanks

    Thys Brits
    MCSD/MCAD


  • Peter Huang [MSFT]

    #2
    RE: Could not access 'CDO.Message' object

    Hi Thys,

    Have you ever sent e-mail successfully with System.Web.Mail class before
    you installed the Office XP?
    Can you tell me if your smtp server used to send email need client
    authentication, which may caused the problem, Since you can not set the
    client authentication with the System.Web.Mail class?


    Regards,
    Peter Huang
    Microsoft Online Partner Support
    Get Secure! www.microsoft.com/security
    This posting is provided "as is" with no warranties and confers no rights.

    --------------------[color=blue]
    >From: "Thys Brits" <thys@jtsoftwar e.co.za>
    >Subject: Could not access 'CDO.Message' object
    >Date: Sun, 21 Sep 2003 17:57:41 +0200
    >Lines: 15
    >X-Priority: 3
    >X-MSMail-Priority: Normal
    >X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
    >X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
    >Message-ID: <O1SLXkFgDHA.22 60@TK2MSFTNGP10 .phx.gbl>
    >Newsgroups: microsoft.publi c.dotnet.genera l
    >NNTP-Posting-Host: c5-pta-49.dial-up.net 196.33.244.49
    >Path: cpmsftngxa06.ph x.gbl!TK2MSFTNG P08.phx.gbl!TK2 MSFTNGP10.phx.g bl
    >Xref: cpmsftngxa06.ph x.gbl microsoft.publi c.dotnet.genera l:109325
    >X-Tomcat-NG: microsoft.publi c.dotnet.genera l
    >
    >Hi,
    >
    >I'm using the System.Web.Mail class to send an e-mail from my ASP.Net
    >application, but when sending the e-mail, I'm getting the above error. It
    >seems to be because I have Office XP installed, and the version of CDO is
    >replaced by this installation. I haven't been able to find this error
    >anywhere on any MS site. Anyone have a clue on how to then actually send[/color]
    the[color=blue]
    >e-mail?
    >
    >Thanks
    >
    >Thys Brits
    >MCSD/MCAD
    >
    >
    >[/color]

    Comment

    • Thys Brits

      #3
      Re: Could not access 'CDO.Message' object

      Hi,

      I added a reference to Microsoft CDO for Exchange library in my project, and
      changed the code to use CDO.MessageClas s (and had to change a few
      properties, including the Configuration.F ields). This works, although there
      are no authentication properties set. I'm using my local SMTP server, and it
      worked using the code below (the code is run in a web server control):

      CDO.MessageClas s mail = new CDO.MessageClas s();
      mail.Subject = "Record change";
      mail.From = "test@test.co.z a)";
      mail.HTMLBody = "<HTML><Body><F ont Face=\"Arial\" Size=\"2\">";
      mail.HTMLBody += "A change has been made to a record in the table <b>" +
      strTable + "</b> by " + this.Page.Sessi on["UserName"] + ".<br>";
      string sURL = this.Page.Reque st.Url.ToString ();
      mail.HTMLBody += "<p>To view the change(s), visit the website at <A href=\""
      + sURL + "\">" + sURL + "</a>.";
      mail.HTMLBody += "</Font></Body></HTML>";
      mail.BCC = "test@test.co.z a";
      mail.To = recip.Substring (0, recip.Length - 1); //recip is a string
      containing all the recipients
      mail.Configurat ion.Fields["http://schemas.microso ft.com/cdo/configuration/se
      ndusing"].Value = 2;
      mail.Configurat ion.Fields["http://schemas.microso ft.com/cdo/configuration/sm
      tpserverport"].Value = 25;
      if(this.Page.Ap plication["MailServer "] != null)
      {

      mail.Configurat ion.Fields["http://schemas.microso ft.com/cdo/configuration/sm
      tpserver"].Value = this.Page.Appli cation["MailServer "].ToString();
      }
      mail.Configurat ion.Fields.Upda te();
      mail.Send();

      I haven't tried sending mail before installing Office XP, the only reason I
      thought it might be this, is because I found an article on MS website saying
      that Office XP replaces the CDO library, and replaces the reference to it in
      the registry. Any further ideas?

      Thys Brits

      PS - I should warn everyone - don't post with your real e-mail address -
      since posting my original message, I've been spammed with these stupid
      "Microsoft Update" virus e-mails - I've received about 30 in the last 18
      hours.... MS should find these people and sue them for identity theft, etc,
      etc, etc....

      "Peter Huang [MSFT]" <v-phuang@online.m icrosoft.com> wrote in message
      news:PqPatGLgDH A.2632@cpmsftng xa06.phx.gbl...[color=blue]
      > Hi Thys,
      >
      > Have you ever sent e-mail successfully with System.Web.Mail class before
      > you installed the Office XP?
      > Can you tell me if your smtp server used to send email need client
      > authentication, which may caused the problem, Since you can not set the
      > client authentication with the System.Web.Mail class?
      >
      >
      > Regards,
      > Peter Huang
      > Microsoft Online Partner Support
      > Get Secure! www.microsoft.com/security
      > This posting is provided "as is" with no warranties and confers no rights.
      >
      > --------------------[color=green]
      > >From: "Thys Brits" <thys@jtsoftwar e.co.za>
      > >Subject: Could not access 'CDO.Message' object
      > >Date: Sun, 21 Sep 2003 17:57:41 +0200
      > >Lines: 15
      > >X-Priority: 3
      > >X-MSMail-Priority: Normal
      > >X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
      > >X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
      > >Message-ID: <O1SLXkFgDHA.22 60@TK2MSFTNGP10 .phx.gbl>
      > >Newsgroups: microsoft.publi c.dotnet.genera l
      > >NNTP-Posting-Host: c5-pta-49.dial-up.net 196.33.244.49
      > >Path: cpmsftngxa06.ph x.gbl!TK2MSFTNG P08.phx.gbl!TK2 MSFTNGP10.phx.g bl
      > >Xref: cpmsftngxa06.ph x.gbl microsoft.publi c.dotnet.genera l:109325
      > >X-Tomcat-NG: microsoft.publi c.dotnet.genera l
      > >
      > >Hi,
      > >
      > >I'm using the System.Web.Mail class to send an e-mail from my ASP.Net
      > >application, but when sending the e-mail, I'm getting the above error. It
      > >seems to be because I have Office XP installed, and the version of CDO is
      > >replaced by this installation. I haven't been able to find this error
      > >anywhere on any MS site. Anyone have a clue on how to then actually send[/color]
      > the[color=green]
      > >e-mail?
      > >
      > >Thanks
      > >
      > >Thys Brits
      > >MCSD/MCAD
      > >
      > >
      > >[/color]
      >[/color]


      Comment

      • Thys Brits

        #4
        Re: Could not access 'CDO.Message' object - The answer

        For those of you who were wondering about this, I found the solution. It's a
        permissions problem. I added the following code at the top of my class, and
        it worked!

        using System.Security .Permissions;
        [assembly:Permis sionSetAttribut e(SecurityActio n.RequestMinimu m, Name =
        "LocalIntranet" )]

        Thys Brits
        MCSD/MCSD.Net

        "Thys Brits" <thys@jtsoftwar e.co.za> wrote in message
        news:%23Cv36mNg DHA.128@tk2msft ngp13.phx.gbl.. .[color=blue]
        > Hi,
        >
        > I added a reference to Microsoft CDO for Exchange library in my project,[/color]
        and[color=blue]
        > changed the code to use CDO.MessageClas s (and had to change a few
        > properties, including the Configuration.F ields). This works, although[/color]
        there[color=blue]
        > are no authentication properties set. I'm using my local SMTP server, and[/color]
        it[color=blue]
        > worked using the code below (the code is run in a web server control):
        >
        > CDO.MessageClas s mail = new CDO.MessageClas s();
        > mail.Subject = "Record change";
        > mail.From = "test@test.co.z a)";
        > mail.HTMLBody = "<HTML><Body><F ont Face=\"Arial\" Size=\"2\">";
        > mail.HTMLBody += "A change has been made to a record in the table <b>" +
        > strTable + "</b> by " + this.Page.Sessi on["UserName"] + ".<br>";
        > string sURL = this.Page.Reque st.Url.ToString ();
        > mail.HTMLBody += "<p>To view the change(s), visit the website at <A[/color]
        href=\""[color=blue]
        > + sURL + "\">" + sURL + "</a>.";
        > mail.HTMLBody += "</Font></Body></HTML>";
        > mail.BCC = "test@test.co.z a";
        > mail.To = recip.Substring (0, recip.Length - 1); //recip is a string
        > containing all the recipients
        >[/color]
        mail.Configurat ion.Fields["http://schemas.microso ft.com/cdo/configuration/se[color=blue]
        > ndusing"].Value = 2;
        >[/color]
        mail.Configurat ion.Fields["http://schemas.microso ft.com/cdo/configuration/sm[color=blue]
        > tpserverport"].Value = 25;
        > if(this.Page.Ap plication["MailServer "] != null)
        > {
        >
        >[/color]
        mail.Configurat ion.Fields["http://schemas.microso ft.com/cdo/configuration/sm[color=blue]
        > tpserver"].Value = this.Page.Appli cation["MailServer "].ToString();
        > }
        > mail.Configurat ion.Fields.Upda te();
        > mail.Send();
        >
        > I haven't tried sending mail before installing Office XP, the only reason[/color]
        I[color=blue]
        > thought it might be this, is because I found an article on MS website[/color]
        saying[color=blue]
        > that Office XP replaces the CDO library, and replaces the reference to it[/color]
        in[color=blue]
        > the registry. Any further ideas?
        >
        > Thys Brits
        >
        > PS - I should warn everyone - don't post with your real e-mail address -
        > since posting my original message, I've been spammed with these stupid
        > "Microsoft Update" virus e-mails - I've received about 30 in the last 18
        > hours.... MS should find these people and sue them for identity theft,[/color]
        etc,[color=blue]
        > etc, etc....
        >
        > "Peter Huang [MSFT]" <v-phuang@online.m icrosoft.com> wrote in message
        > news:PqPatGLgDH A.2632@cpmsftng xa06.phx.gbl...[color=green]
        > > Hi Thys,
        > >
        > > Have you ever sent e-mail successfully with System.Web.Mail class before
        > > you installed the Office XP?
        > > Can you tell me if your smtp server used to send email need client
        > > authentication, which may caused the problem, Since you can not set the
        > > client authentication with the System.Web.Mail class?
        > >
        > >
        > > Regards,
        > > Peter Huang
        > > Microsoft Online Partner Support
        > > Get Secure! www.microsoft.com/security
        > > This posting is provided "as is" with no warranties and confers no[/color][/color]
        rights.[color=blue][color=green]
        > >
        > > --------------------[color=darkred]
        > > >From: "Thys Brits" <thys@jtsoftwar e.co.za>
        > > >Subject: Could not access 'CDO.Message' object
        > > >Date: Sun, 21 Sep 2003 17:57:41 +0200
        > > >Lines: 15
        > > >X-Priority: 3
        > > >X-MSMail-Priority: Normal
        > > >X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
        > > >X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
        > > >Message-ID: <O1SLXkFgDHA.22 60@TK2MSFTNGP10 .phx.gbl>
        > > >Newsgroups: microsoft.publi c.dotnet.genera l
        > > >NNTP-Posting-Host: c5-pta-49.dial-up.net 196.33.244.49
        > > >Path: cpmsftngxa06.ph x.gbl!TK2MSFTNG P08.phx.gbl!TK2 MSFTNGP10.phx.g bl
        > > >Xref: cpmsftngxa06.ph x.gbl microsoft.publi c.dotnet.genera l:109325
        > > >X-Tomcat-NG: microsoft.publi c.dotnet.genera l
        > > >
        > > >Hi,
        > > >
        > > >I'm using the System.Web.Mail class to send an e-mail from my ASP.Net
        > > >application, but when sending the e-mail, I'm getting the above error.[/color][/color][/color]
        It[color=blue][color=green][color=darkred]
        > > >seems to be because I have Office XP installed, and the version of CDO[/color][/color][/color]
        is[color=blue][color=green][color=darkred]
        > > >replaced by this installation. I haven't been able to find this error
        > > >anywhere on any MS site. Anyone have a clue on how to then actually[/color][/color][/color]
        send[color=blue][color=green]
        > > the[color=darkred]
        > > >e-mail?
        > > >
        > > >Thanks
        > > >
        > > >Thys Brits
        > > >MCSD/MCAD
        > > >
        > > >
        > > >[/color]
        > >[/color]
        >
        >[/color]


        Comment

        • senani28
          New Member
          • Jul 2006
          • 1

          #5
          Hi , can somebody tell me the solution for VB.NET

          Comment

          Working...