ASPNET user and CDO

Discussion in 'ASP .Net Security' started by Damien, Oct 15, 2003.

  1. Damien

    Damien Guest

    Hi all,
    I have a problem in and around the ASPNET user and CDO, my code is as
    follows

    using System;
    using System.Web.Mail;

    MailMessage mm = new MailMessage();

    //set the properties
    mm.To = "";
    mm.Subject = "subject - test";
    mm.Body = "message - test";
    mm.From = "";
    SmtpMail.Send(mm);

    If I round this code from a test harness it works fine but I fire it from an
    ASP.NET application I get the following error

    Message : Could not access 'CDO.Message' object.
    Source : System.Web
    Inner Ex : Exception has been thrown by the target of an invocation.

    which lead me to believe that this was a permissions error, so I added the
    ASPNET user to the administrators group to narrow down possibilities and
    this allowed the application to mail away tills its hearts content
    unfortunately my customer would not be happy (r they ever) with the ASPNET
    user having admin rights.

    Does anyone have an idea of what specifically the ASPNET user needs to
    access the CDO class.

    I have used this functionality before with no trouble but the whole company
    has just recently updated windows 2000 to service pack 4

    Cheers D
    Damien, Oct 15, 2003
    #1
    1. Advertising

  2. Damien

    Jeff Guest

    Make sure that the ASPNET account has read access to the CDOSYS.DLL (usually
    in System32) and that it can write to the InetPub\MailRoot directories.

    Jeff

    "Damien" <> wrote in message
    news:xhdjb.322$...
    > Hi all,
    > I have a problem in and around the ASPNET user and CDO, my code is as
    > follows
    >
    > using System;
    > using System.Web.Mail;
    >
    > MailMessage mm = new MailMessage();
    >
    > //set the properties
    > mm.To = "";
    > mm.Subject = "subject - test";
    > mm.Body = "message - test";
    > mm.From = "";
    > SmtpMail.Send(mm);
    >
    > If I round this code from a test harness it works fine but I fire it from

    an
    > ASP.NET application I get the following error
    >
    > Message : Could not access 'CDO.Message' object.
    > Source : System.Web
    > Inner Ex : Exception has been thrown by the target of an invocation.
    >
    > which lead me to believe that this was a permissions error, so I added the
    > ASPNET user to the administrators group to narrow down possibilities and
    > this allowed the application to mail away tills its hearts content
    > unfortunately my customer would not be happy (r they ever) with the ASPNET
    > user having admin rights.
    >
    > Does anyone have an idea of what specifically the ASPNET user needs to
    > access the CDO class.
    >
    > I have used this functionality before with no trouble but the whole

    company
    > has just recently updated windows 2000 to service pack 4
    >
    > Cheers D
    >
    >
    >
    Jeff, Nov 8, 2003
    #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. Guest
    Replies:
    2
    Views:
    844
    dave wanta
    Jul 11, 2003
  2. Damien

    ASPNET user and CDO

    Damien, Oct 15, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    379
    Damien
    Oct 15, 2003
  3. Gary Nelson

    Upgrade from aspnet 1.1 to aspnet 2.0

    Gary Nelson, Oct 14, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    464
    Gary Nelson
    Oct 14, 2005
  4. Replies:
    7
    Views:
    612
    Juan T. Llibre
    Mar 23, 2007
  5. Replies:
    0
    Views:
    254
Loading...

Share This Page