Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Error:- Could not access 'CDO.Message' object.

Error:- Could not access 'CDO.Message' object.

Scheduled Pinned Locked Moved C#
helpcsharphtmlcom
6 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    nachisaravanan
    wrote on last edited by
    #1

    Hi, I tried to send mail from c# windows application but i am unable to send the mail.i am getting the following error. An unhandled exception of type 'System.Web.HttpException' occurred in system.web.dll Additional information: Could not access 'CDO.Message' object. The code i wrote is System.Web.Mail.MailMessage mailMsg = new MailMessage(); mailMsg.From ="chand.p@icinfotech.com"; mailMsg.To = "chand.p@icinfotech.com"; mailMsg.Priority = MailPriority.High; mailMsg.Subject = subject; mailMsg.Body = body; mailMsg.BodyFormat = System.Web.Mail.MailFormat.Html; MailAttachment sFile = new MailAttachment(attachment); mailMsg.Attachments.Add(sFile); SmtpMail.SmtpServer = "127.0.0.1"; SmtpMail.Send(mailMsg); reply me if any one know the solution for this problem.

    N 1 Reply Last reply
    0
    • N nachisaravanan

      Hi, I tried to send mail from c# windows application but i am unable to send the mail.i am getting the following error. An unhandled exception of type 'System.Web.HttpException' occurred in system.web.dll Additional information: Could not access 'CDO.Message' object. The code i wrote is System.Web.Mail.MailMessage mailMsg = new MailMessage(); mailMsg.From ="chand.p@icinfotech.com"; mailMsg.To = "chand.p@icinfotech.com"; mailMsg.Priority = MailPriority.High; mailMsg.Subject = subject; mailMsg.Body = body; mailMsg.BodyFormat = System.Web.Mail.MailFormat.Html; MailAttachment sFile = new MailAttachment(attachment); mailMsg.Attachments.Add(sFile); SmtpMail.SmtpServer = "127.0.0.1"; SmtpMail.Send(mailMsg); reply me if any one know the solution for this problem.

      N Offline
      N Offline
      Not Active
      wrote on last edited by
      #2

      Unless your local machine is the mail server you will need to set SmtpServer to a valid address, maybe something like mail.mycompany.com or 234.10.44.20

      N 1 Reply Last reply
      0
      • N Not Active

        Unless your local machine is the mail server you will need to set SmtpServer to a valid address, maybe something like mail.mycompany.com or 234.10.44.20

        N Offline
        N Offline
        nachisaravanan
        wrote on last edited by
        #3

        hi thanks for replying me. i have used my company mail server but i am receiving the same error.i tried this in vs2003 but in vs2005 it is working fine.

        N 1 Reply Last reply
        0
        • N nachisaravanan

          hi thanks for replying me. i have used my company mail server but i am receiving the same error.i tried this in vs2003 but in vs2005 it is working fine.

          N Offline
          N Offline
          Not Active
          wrote on last edited by
          #4

          If you are using VS2005 you should use the System.Net.Mail namespace, System.Web.Mail has been deprecated.

          N 1 Reply Last reply
          0
          • N Not Active

            If you are using VS2005 you should use the System.Net.Mail namespace, System.Web.Mail has been deprecated.

            N Offline
            N Offline
            nachisaravanan
            wrote on last edited by
            #5

            Yes,i used System.Net.Mail namespace in vs2005.Do you have any alternate solution for my problem?if any,please kindly reply.

            N 1 Reply Last reply
            0
            • N nachisaravanan

              Yes,i used System.Net.Mail namespace in vs2005.Do you have any alternate solution for my problem?if any,please kindly reply.

              N Offline
              N Offline
              Not Active
              wrote on last edited by
              #6

              I don't realy see that you have a problem. It works with VS2005 but not with VS2003, so the obvious answer is to use what works. Is there a reason why it needs to work using .NET 1.1?

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups