outlook automation error in asp.net ....


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 5 of 5

Thread: outlook automation error in asp.net ....

  1. #1
    geeta Guest

    outlook automation error in asp.net ....


    Hi all,

    I am having problems in automating the outlook....I gave full access to
    '{machinename}\ASPNET' User....But still not working...It gives me ERROR
    as given below:
    Access is denied.
    Description: An unhandled exception occurred during the execution of the
    current web request. Please review the stack trace for more information
    about the error and where it originated in the code.

    Exception Details: System.UnauthorizedAccessException: Access is denied.


    The ASP.NET process is not authorized to access the requested resource.
    For security reasons the default ASP.NET process identity is
    '{machinename}\ASPNET', which has limited privileges. Consider granting
    access rights to the resource to the ASP.NET process identity.


    To grant ASP.NET write access to a file, right-click the file in
    Explorer, choose "Properties" and select the Security tab. Click "Add"
    to add the "{machinename}\ASPNET" user. Highlight the ASP.NET account,
    and check the Write box in the Allow column.
    Source Error:


    Line 31: string strMsg;

    Line 32: strMsg="";
    Line 33: myApp = new Outlook.ApplicationClass();




    Thanks ,
    Geeta



  2. #2
    Kurt Guest

    Re: outlook automation error in asp.net ....


    Hi
    I have excactly the same error and can not find the solution.
    Do you have anything in mind
    Thanks
    Kurt

    "geeta" <dotnetgeeta@hotmail.com> wrote:
    >
    >Hi all,
    >
    >I am having problems in automating the outlook....I gave full access to
    >'{machinename}\ASPNET' User....But still not working...It gives me ERROR
    >as given below:
    >Access is denied.
    >Description: An unhandled exception occurred during the execution of the
    >current web request. Please review the stack trace for more information
    >about the error and where it originated in the code.
    >
    >Exception Details: System.UnauthorizedAccessException: Access is denied.
    >
    >
    >The ASP.NET process is not authorized to access the requested resource.
    >For security reasons the default ASP.NET process identity is
    >'{machinename}\ASPNET', which has limited privileges. Consider granting
    >access rights to the resource to the ASP.NET process identity.
    >
    >
    >To grant ASP.NET write access to a file, right-click the file in
    >Explorer, choose "Properties" and select the Security tab. Click "Add"
    >to add the "{machinename}\ASPNET" user. Highlight the ASP.NET account,
    >and check the Write box in the Allow column.
    >Source Error:
    >
    >
    >Line 31: string strMsg;
    >
    >Line 32: strMsg="";
    >Line 33: myApp = new Outlook.ApplicationClass();
    >
    >
    >
    >
    >Thanks ,
    >Geeta
    >
    >



  3. #3
    Sreejath S. Warrier Guest

    Re: outlook automation error in asp.net ....

    Geeta,
    Seems there is something missing here.
    Could you please post the code?
    Regards,
    Sreejath S. Warrier
    "geeta" <dotnetgeeta@hotmail.com> wrote in message
    news:3d4805fd$1@10.1.10.29...
    >
    > Hi all,
    >
    > I am having problems in automating the outlook....I gave full access to
    > '{machinename}\ASPNET' User....But still not working...It gives me ERROR
    > as given below:
    > Access is denied.
    > Description: An unhandled exception occurred during the execution of the
    > current web request. Please review the stack trace for more information
    > about the error and where it originated in the code.
    >
    > Exception Details: System.UnauthorizedAccessException: Access is denied.
    >
    >
    > The ASP.NET process is not authorized to access the requested resource.
    > For security reasons the default ASP.NET process identity is
    > '{machinename}\ASPNET', which has limited privileges. Consider granting
    > access rights to the resource to the ASP.NET process identity.
    >
    >
    > To grant ASP.NET write access to a file, right-click the file in
    > Explorer, choose "Properties" and select the Security tab. Click "Add"
    > to add the "{machinename}\ASPNET" user. Highlight the ASP.NET account,
    > and check the Write box in the Allow column.
    > Source Error:
    >
    >
    > Line 31: string strMsg;
    >
    > Line 32: strMsg="";
    > Line 33: myApp = new Outlook.ApplicationClass();
    >
    >
    >
    >
    > Thanks ,
    > Geeta
    >
    >




  4. #4
    Join Date
    Jul 2006
    Posts
    1

    Automate Outlook via .net

    hello Sreejath S. Warrier,

    My Code :
    Outlook._Application app = null;
    Outlook._NameSpace nameSpace = null;
    Outlook.MailItem memo = null;
    Outlook.MAPIFolder outbox = null;

    try
    {
    app = new Outlook.ApplicationClass();
    nameSpace = app.GetNamespace("MAPI");
    nameSpace.Logon(null,null,false, false);
    outbox = nameSpace.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderDrafts);
    memo = (Outlook.MailItem)app.CreateItem(Outlook.OlItemType.olMailItem);
    memo.To = "wf.tl@recordsanddata.com";
    memo.Subject = "TechRepublic.com Test";
    memo.Body = "Hello there";
    memo.SaveSentMessageFolder = outbox;
    memo.Send();
    }
    catch(System.Exception ex)
    {
    Response.Write(ex.ToString());
    }

    I got error at line
    app = new Outlook.ApplicationClass();
    i.e.
    Access is denied

    Have u got any solution
    Please help

  5. #5
    Join Date
    Feb 2007
    Posts
    1

    Need to add a referense

    Hi there

    I think that you need to add referense to
    MS Outlook 11.0 Object Librerary.

    Add Referense in your project >> COM >> MS Outlook 11.0 Object Librerary.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center