Cannot access 'CDO' object.

Discussion in 'ASP .Net' started by Martin Robins, Jan 30, 2006.

  1. I know that this has been asked before; and not only that, I know that it has been answered (successfully) as I myself have previously resolved the problem (with help) - however, I cannot for the life of me remember what the solution was.

    I am trying to send an email from an ASP.net application. If I send the email with the MailMessage.BodyFormat = MailFormat.Text then it sends fine; if I set MailMessage.BodyFormat = MailFormat.Html then I get the following exception:
    COMException (0x80040605): Unknown Error]

    [TargetInvocationException: Exception has been thrown by the target of an invocation.]
    System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture, String[] namedParameters) +0
    System.RuntimeType.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParameters) +473
    System.Type.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args) +29
    System.Web.Mail.LateBoundAccessHelper.SetProp(Type type, Object obj, String propName, Object propValue)
    System.Web.Mail.LateBoundAccessHelper.SetProp(Object obj, String propName, Object propValue)

    [HttpException (0x80004005): Could not access 'CDO.Message' object.]
    System.Web.Mail.LateBoundAccessHelper.SetProp(Object obj, String propName, Object propValue)
    System.Web.Mail.CdoSysHelper.Send(MailMessage message)
    System.Web.Mail.SmtpMail.Send(MailMessage message)
    My code is simple:
    // Prepare the message to be sent ...
    MailMessage mailMessage = new MailMessage();
    mailMessage.To = "martin.robins@..."; // Changed to avoid spam
    mailMessage.From = "emails@..."; // Changed to avoid spam
    mailMessage.Subject = "My email";
    mailMessage.BodyFormat = MailFormat.Html;
    mailMessage.Body = "<html><body>Welcome<P>New line text<BR>Another line</P></body></html>";
    SmtpMail.SmtpServer = "MyServer";
    SmtpMail.Send(mailMessage);
    I am using Framework 1.1 on Windows/XP Pro - I also have Office 2003 installed (I seem to recall that this is relevant)

    All help gratefully accepted. I have already tried the usual candidates (MS Knowledgebase, systemwebmail.com etc.) and I cannot find the answer on there. I have also tried catching the exception and looking for inner exceptions; I cannot identify any further information from them than is shown above!

    Thanks.
     
    Martin Robins, Jan 30, 2006
    #1
    1. Advertising

  2. Martin Robins

    Newbie Guest

    Most likley scenario is that your machine ( server ) is not enabled to allow mail relay. You need to correct this. See your exchange settings or look in your policy documents on your local machine if this is where you are running it from.
    "Martin Robins" <martin dot robins at technicaldirect dot co dot uk> wrote in message news:...
    I know that this has been asked before; and not only that, I know that it has been answered (successfully) as I myself have previously resolved the problem (with help) - however, I cannot for the life of me remember what the solution was.

    I am trying to send an email from an ASP.net application. If I send the email with the MailMessage.BodyFormat = MailFormat.Text then it sends fine; if I set MailMessage.BodyFormat = MailFormat.Html then I get the following exception:
    COMException (0x80040605): Unknown Error]

    [TargetInvocationException: Exception has been thrown by the target of an invocation.]
    System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture, String[] namedParameters) +0
    System.RuntimeType.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParameters) +473
    System.Type.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args) +29
    System.Web.Mail.LateBoundAccessHelper.SetProp(Type type, Object obj, String propName, Object propValue)
    System.Web.Mail.LateBoundAccessHelper.SetProp(Object obj, String propName, Object propValue)

    [HttpException (0x80004005): Could not access 'CDO.Message' object.]
    System.Web.Mail.LateBoundAccessHelper.SetProp(Object obj, String propName, Object propValue)
    System.Web.Mail.CdoSysHelper.Send(MailMessage message)
    System.Web.Mail.SmtpMail.Send(MailMessage message)
    My code is simple:
    // Prepare the message to be sent ...
    MailMessage mailMessage = new MailMessage();
    mailMessage.To = "martin.robins@..."; // Changed to avoid spam
    mailMessage.From = "emails@..."; // Changed to avoid spam
    mailMessage.Subject = "My email";
    mailMessage.BodyFormat = MailFormat.Html;
    mailMessage.Body = "<html><body>Welcome<P>New line text<BR>Another line</P></body></html>";
    SmtpMail.SmtpServer = "MyServer";
    SmtpMail.Send(mailMessage);
    I am using Framework 1.1 on Windows/XP Pro - I also have Office 2003 installed (I seem to recall that this is relevant)

    All help gratefully accepted. I have already tried the usual candidates (MS Knowledgebase, systemwebmail.com etc.) and I cannot find the answer on there. I have also tried catching the exception and looking for inner exceptions; I cannot identify any further information from them than is shown above!

    Thanks.
     
    Newbie, Jan 30, 2006
    #2
    1. Advertising

  3. Unfortunately this cannot be the case; if I send the message as text instead of HTML everything works. This rules out the SMTP server as it is relaying the non-HTML messages ok.
    "Newbie" <> wrote in message news:...
    Most likley scenario is that your machine ( server ) is not enabled to allow mail relay. You need to correct this. See your exchange settings or look in your policy documents on your local machine if this is where you are running it from.
    "Martin Robins" <martin dot robins at technicaldirect dot co dot uk> wrote in message news:...
    I know that this has been asked before; and not only that, I know that it has been answered (successfully) as I myself have previously resolved the problem (with help) - however, I cannot for the life of me remember what the solution was.

    I am trying to send an email from an ASP.net application. If I send the email with the MailMessage.BodyFormat = MailFormat.Text then it sends fine; if I set MailMessage.BodyFormat = MailFormat.Html then I get the following exception:
    COMException (0x80040605): Unknown Error]

    [TargetInvocationException: Exception has been thrown by the target of an invocation.]
    System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture, String[] namedParameters) +0
    System.RuntimeType.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParameters) +473
    System.Type.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args) +29
    System.Web.Mail.LateBoundAccessHelper.SetProp(Type type, Object obj, String propName, Object propValue)
    System.Web.Mail.LateBoundAccessHelper.SetProp(Object obj, String propName, Object propValue)

    [HttpException (0x80004005): Could not access 'CDO.Message' object.]
    System.Web.Mail.LateBoundAccessHelper.SetProp(Object obj, String propName, Object propValue)
    System.Web.Mail.CdoSysHelper.Send(MailMessage message)
    System.Web.Mail.SmtpMail.Send(MailMessage message)
    My code is simple:
    // Prepare the message to be sent ...
    MailMessage mailMessage = new MailMessage();
    mailMessage.To = "martin.robins@..."; // Changed to avoid spam
    mailMessage.From = "emails@..."; // Changed to avoid spam
    mailMessage.Subject = "My email";
    mailMessage.BodyFormat = MailFormat.Html;
    mailMessage.Body = "<html><body>Welcome<P>New line text<BR>Another line</P></body></html>";
    SmtpMail.SmtpServer = "MyServer";
    SmtpMail.Send(mailMessage);
    I am using Framework 1.1 on Windows/XP Pro - I also have Office 2003 installed (I seem to recall that this is relevant)

    All help gratefully accepted. I have already tried the usual candidates (MS Knowledgebase, systemwebmail.com etc.) and I cannot find the answer on there. I have also tried catching the exception and looking for inner exceptions; I cannot identify any further information from them than is shown above!

    Thanks.
     
    Martin Robins, Jan 30, 2006
    #3
  4. Martin Robins

    Sonu Kapoor Guest

    Sonu Kapoor, Jan 31, 2006
    #4
  5. Martins you should be able to get some more info here at:-
    http://www.systemwebmail.com/
    Hope that helps
    Patrick

    "Martin Robins" <martin at orpheus-solutions dot co dot uk> wrote in message news:...
    Unfortunately this cannot be the case; if I send the message as text instead of HTML everything works. This rules out the SMTP server as it is relaying the non-HTML messages ok.
    "Newbie" <> wrote in message news:...
    Most likley scenario is that your machine ( server ) is not enabled to allow mail relay. You need to correct this. See your exchange settings or look in your policy documents on your local machine if this is where you are running it from.
    "Martin Robins" <martin dot robins at technicaldirect dot co dot uk> wrote in message news:...
    I know that this has been asked before; and not only that, I know that it has been answered (successfully) as I myself have previously resolved the problem (with help) - however, I cannot for the life of me remember what the solution was.

    I am trying to send an email from an ASP.net application. If I send the email with the MailMessage.BodyFormat = MailFormat.Text then it sends fine; if I set MailMessage.BodyFormat = MailFormat.Html then I get the following exception:
    COMException (0x80040605): Unknown Error]

    [TargetInvocationException: Exception has been thrown by the target of an invocation.]
    System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture, String[] namedParameters) +0
    System.RuntimeType.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParameters) +473
    System.Type.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args) +29
    System.Web.Mail.LateBoundAccessHelper.SetProp(Type type, Object obj, String propName, Object propValue)
    System.Web.Mail.LateBoundAccessHelper.SetProp(Object obj, String propName, Object propValue)

    [HttpException (0x80004005): Could not access 'CDO.Message' object.]
    System.Web.Mail.LateBoundAccessHelper.SetProp(Object obj, String propName, Object propValue)
    System.Web.Mail.CdoSysHelper.Send(MailMessage message)
    System.Web.Mail.SmtpMail.Send(MailMessage message)
    My code is simple:
    // Prepare the message to be sent ...
    MailMessage mailMessage = new MailMessage();
    mailMessage.To = "martin.robins@..."; // Changed to avoid spam
    mailMessage.From = "emails@..."; // Changed to avoid spam
    mailMessage.Subject = "My email";
    mailMessage.BodyFormat = MailFormat.Html;
    mailMessage.Body = "<html><body>Welcome<P>New line text<BR>Another line</P></body></html>";
    SmtpMail.SmtpServer = "MyServer";
    SmtpMail.Send(mailMessage);
    I am using Framework 1.1 on Windows/XP Pro - I also have Office 2003 installed (I seem to recall that this is relevant)

    All help gratefully accepted. I have already tried the usual candidates (MS Knowledgebase, systemwebmail.com etc.) and I cannot find the answer on there. I have also tried catching the exception and looking for inner exceptions; I cannot identify any further information from them than is shown above!

    Thanks.
     
    Patrick.O.Ige, Jan 31, 2006
    #5
  6. Thanks Patrick; but as I stated in my original message, I have already been through all of the options on that site. These fixes all seem to apply to errors with the SmtpServer configuration.

    My problem is more specific; the error only occurs when I am sending a message as HTML - if I send text all is well.

    Martin.

    "Patrick.O.Ige" <> wrote in message news:...
    Martins you should be able to get some more info here at:-
    http://www.systemwebmail.com/
    Hope that helps
    Patrick

    "Martin Robins" <martin at orpheus-solutions dot co dot uk> wrote in message news:...
    Unfortunately this cannot be the case; if I send the message as text instead of HTML everything works. This rules out the SMTP server as it is relaying the non-HTML messages ok.
    "Newbie" <> wrote in message news:...
    Most likley scenario is that your machine ( server ) is not enabled to allow mail relay. You need to correct this. See your exchange settings or look in your policy documents on your local machine if this is where you are running it from.
    "Martin Robins" <martin dot robins at technicaldirect dot co dot uk> wrote in message news:...
    I know that this has been asked before; and not only that, I know that it has been answered (successfully) as I myself have previously resolved the problem (with help) - however, I cannot for the life of me remember what the solution was.

    I am trying to send an email from an ASP.net application. If I send the email with the MailMessage.BodyFormat = MailFormat.Text then it sends fine; if I set MailMessage.BodyFormat = MailFormat.Html then I get the following exception:
    COMException (0x80040605): Unknown Error]

    [TargetInvocationException: Exception has been thrown by the target of an invocation.]
    System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture, String[] namedParameters) +0
    System.RuntimeType.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParameters) +473
    System.Type.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args) +29
    System.Web.Mail.LateBoundAccessHelper.SetProp(Type type, Object obj, String propName, Object propValue)
    System.Web.Mail.LateBoundAccessHelper.SetProp(Object obj, String propName, Object propValue)

    [HttpException (0x80004005): Could not access 'CDO.Message' object.]
    System.Web.Mail.LateBoundAccessHelper.SetProp(Object obj, String propName, Object propValue)
    System.Web.Mail.CdoSysHelper.Send(MailMessage message)
    System.Web.Mail.SmtpMail.Send(MailMessage message)
    My code is simple:
    // Prepare the message to be sent ...
    MailMessage mailMessage = new MailMessage();
    mailMessage.To = "martin.robins@..."; // Changed to avoid spam
    mailMessage.From = "emails@..."; // Changed to avoid spam
    mailMessage.Subject = "My email";
    mailMessage.BodyFormat = MailFormat.Html;
    mailMessage.Body = "<html><body>Welcome<P>New line text<BR>Another line</P></body></html>";
    SmtpMail.SmtpServer = "MyServer";
    SmtpMail.Send(mailMessage);
    I am using Framework 1.1 on Windows/XP Pro - I also have Office 2003 installed (I seem to recall that this is relevant)

    All help gratefully accepted. I have already tried the usual candidates (MS Knowledgebase, systemwebmail.com etc.) and I cannot find the answer on there. I have also tried catching the exception and looking for inner exceptions; I cannot identify any further information from them than is shown above!

    Thanks.
     
    Martin Robins, Jan 31, 2006
    #6
  7. Do you have an anti-virus programs running? If so, it may be configured to
    block HTML messages.

    Mike.

    "Martin Robins" <martin dot robins at technicaldirect dot co dot uk> wrote
    in message news:...
    Thanks Patrick; but as I stated in my original message, I have already been
    through all of the options on that site. These fixes all seem to apply to
    errors with the SmtpServer configuration.

    My problem is more specific; the error only occurs when I am sending a
    message as HTML - if I send text all is well.

    Martin.

    "Patrick.O.Ige" <> wrote in message
    news:...
    Martins you should be able to get some more info here at:-
    http://www.systemwebmail.com/
    Hope that helps
    Patrick

    "Martin Robins" <martin at orpheus-solutions dot co dot uk> wrote in message
    news:...
    Unfortunately this cannot be the case; if I send the message as text instead
    of HTML everything works. This rules out the SMTP server as it is relaying
    the non-HTML messages ok.
    "Newbie" <> wrote in message
    news:...
    Most likley scenario is that your machine ( server ) is not enabled to allow
    mail relay. You need to correct this. See your exchange settings or look in
    your policy documents on your local machine if this is where you are running
    it from.
    "Martin Robins" <martin dot robins at technicaldirect dot co dot uk> wrote
    in message news:...
    I know that this has been asked before; and not only that, I know that it
    has been answered (successfully) as I myself have previously resolved the
    problem (with help) - however, I cannot for the life of me remember what the
    solution was.

    I am trying to send an email from an ASP.net application. If I send the
    email with the MailMessage.BodyFormat = MailFormat.Text then it sends fine;
    if I set MailMessage.BodyFormat = MailFormat.Html then I get the following
    exception:
    COMException (0x80040605): Unknown Error]

    [TargetInvocationException: Exception has been thrown by the target of an
    invocation.]
    System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr,
    Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture,
    String[] namedParameters) +0
    System.RuntimeType.InvokeMember(String name, BindingFlags invokeAttr,
    Binder binder, Object target, Object[] args, ParameterModifier[] modifiers,
    CultureInfo culture, String[] namedParameters) +473
    System.Type.InvokeMember(String name, BindingFlags invokeAttr, Binder
    binder, Object target, Object[] args) +29
    System.Web.Mail.LateBoundAccessHelper.SetProp(Type type, Object obj,
    String propName, Object propValue)
    System.Web.Mail.LateBoundAccessHelper.SetProp(Object obj, String
    propName, Object propValue)

    [HttpException (0x80004005): Could not access 'CDO.Message' object.]
    System.Web.Mail.LateBoundAccessHelper.SetProp(Object obj, String
    propName, Object propValue)
    System.Web.Mail.CdoSysHelper.Send(MailMessage message)
    System.Web.Mail.SmtpMail.Send(MailMessage message)
    My code is simple:
    // Prepare the message to be sent ...
    MailMessage mailMessage = new MailMessage();
    mailMessage.To = "martin.robins@..."; // Changed to avoid spam
    mailMessage.From = "emails@..."; // Changed to avoid spam
    mailMessage.Subject = "My email";
    mailMessage.BodyFormat = MailFormat.Html;
    mailMessage.Body = "<html><body>Welcome<P>New line text<BR>Another
    line</P></body></html>";
    SmtpMail.SmtpServer = "MyServer";
    SmtpMail.Send(mailMessage);
    I am using Framework 1.1 on Windows/XP Pro - I also have Office 2003
    installed (I seem to recall that this is relevant)

    All help gratefully accepted. I have already tried the usual candidates (MS
    Knowledgebase, systemwebmail.com etc.) and I cannot find the answer on
    there. I have also tried catching the exception and looking for inner
    exceptions; I cannot identify any further information from them than is
    shown above!

    Thanks.
     
    Michael D. Ober, Feb 1, 2006
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Anthony Fine
    Replies:
    3
    Views:
    3,240
    Jure Spik
    Feb 12, 2004
  2. Cyndia A.
    Replies:
    0
    Views:
    649
    Cyndia A.
    Jan 14, 2004
  3. Guest
    Replies:
    2
    Views:
    928
    dave wanta
    Jul 11, 2003
  4. Cyndia A.
    Replies:
    1
    Views:
    136
    Dan Boylett
    Jan 14, 2004
  5. Replies:
    0
    Views:
    306
Loading...

Share This Page