SmtpMail Could not access 'CDO.Message' object ONLY with HTML form

Discussion in 'ASP .Net' started by =?Utf-8?B?TWljaGFlbA==?=, Jul 13, 2004.

  1. Hello,

    I've read a lot of threads on this subject, but they typically go back to a problem with the smtp server configuration. In my case, everything works great until I uncomment the one line below. Once I set the BodyFormat to MailFormat.Html then I get:

    HttpException (0x80004005): Could not access 'CDO.Message' object

    Otherwise, everything works fine and I get my html tags in plain text. I've got it working (in plain text) with my local smtp server (as below) and two ISP's... all throw the same error as soon as I set the format to HTML. The email addresses have, of course, been edited for the post.

    Any ideas?
    Thanks,
    Michael

    <CODE>

    MailMessage m = new MailMessage();
    m.To = "";
    m.From = “â€;
    m.Subject = "testing";
    //m.BodyFormat = MailFormat.Html;
    m.Body = "this is my test email body.<br><b>this part is in bold</b>";
    SmtpMail.SmtpServer = "localhost";
    SmtpMail.Send(m);

    </CODE>
    =?Utf-8?B?TWljaGFlbA==?=, Jul 13, 2004
    #1
    1. Advertising

  2. =?Utf-8?B?TWljaGFlbA==?=

    Andy Miller Guest

    I just ran into the same issue (same message...same conditions).
    Switching to text format allows mail to be sent. I suspect it is a
    permission issue. I think the mailer is trying to build at least one
    attachment to handle the HTML. I'm still investigating.

    "Michael" <> wrote in message news:<>...
    > By the way, here's the full error:
    >
    > [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)
    > tms1.mailtest.btnGo_Click(Object sender, EventArgs e) in mailtest.aspx.cs:64
    > System.Web.UI.WebControls.Button.OnClick(EventArgs e)
    > System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
    > System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
    > System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
    > System.Web.UI.Page.ProcessRequestMain()
    >
    > _______________________________________________________________
    >
    > "Michael" wrote:
    >
    > > Hello,
    > >
    > > I've read a lot of threads on this subject, but they typically go back to a problem with the smtp server configuration. In my case, everything works great until I uncomment the one line below. Once I set the BodyFormat to MailFormat.Html then I get:
    > >
    > > HttpException (0x80004005): Could not access 'CDO.Message' object
    > >
    > > Otherwise, everything works fine and I get my html tags in plain text. I've got it working (in plain text) with my local smtp server (as below) and two ISP's... all throw the same error as soon as I set the format to HTML. The email addresses have, of course, been edited for the post.
    > >
    > > Any ideas?
    > > Thanks,
    > > Michael
    > >
    > > <CODE>
    > >
    > > MailMessage m = new MailMessage();
    > > m.To = "";
    > > m.From = “â€;
    > > m.Subject = "testing";
    > > //m.BodyFormat = MailFormat.Html;
    > > m.Body = "this is my test email body.<br><b>this part is in bold</b>";
    > > SmtpMail.SmtpServer = "localhost";
    > > SmtpMail.Send(m);
    > >
    > > </CODE>
    Andy Miller, Jul 24, 2004
    #2
    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. Jibu
    Replies:
    3
    Views:
    512
    Jurjen de Groot
    Aug 26, 2003
  2. DotNetGruven
    Replies:
    3
    Views:
    1,033
    Steven Cheng[MSFT]
    Apr 27, 2004
  3. =?Utf-8?B?SmVucyDDmHN0ZXI=?=

    SmtpMail.Send - Exception "Could not access 'CDO.Message' object"

    =?Utf-8?B?SmVucyDDmHN0ZXI=?=, Jul 7, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    585
    Hans Kesting
    Jul 7, 2004
  4. =?Utf-8?B?SmVucw==?=
    Replies:
    3
    Views:
    7,219
    =?Utf-8?B?SmVucw==?=
    Aug 13, 2004
  5. chuckdfoster
    Replies:
    2
    Views:
    500
    chuckdfoster
    Mar 23, 2005
Loading...

Share This Page