Security issue accessing microsoft interop dll sending email
<p>We have a simple piece of code here that recently stopped working and I have tried many 'things' to try and resolve the error.</p>

<p>The code</p>

<p><code>Application outLook = new Application();</code>  :)</p>

<p>The error</p>

<blockquote>
  <p>Retrieving the COM class factory for component with CLSID
  {0006F03A-0000-0000-C000-000000000046} failed due to the following
  error: 80070005.  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. </p>
  
  <p>Exception Details: System.UnauthorizedAccessException: Retrieving the
  COM class factory for component with CLSID
  {0006F03A-0000-0000-C000-000000000046} failed due to the following
  error: 80070005. </p>
  
  <p>ASP.NET is not authorized to access the requested resource. Consider
  granting access rights to the resource to the ASP.NET request
  identity. ASP.NET has a base process identity (typically
  {MACHINE}\ASPNET on IIS 5 or Network Service on IIS 6) that is used if
  the application is not impersonating. If the application is
  impersonating via , the identity will be
  the anonymous user (typically IUSR_MACHINENAME) or the authenticated
  request user. </p>
  
  <p>To grant ASP.NET access to a file, right-click the file in Explorer,
  choose "Properties" and select the Security tab. Click "Add" to add
  the appropriate user or group. Highlight the ASP.NET account, and
  check the boxes for the desired access.</p>
</blockquote>

<p>Now whilst the error is quite obvious I cannot resolve it.</p>

<p>The application is a .net 2.0 web application and the server is windows 2008 r2 standard using IIS 7.0</p>

<p>Thanks</p>
