Ver Mensaje Individual
  #1 (permalink)  
Antiguo 28/03/2006, 00:38
pous
 
Fecha de Ingreso: noviembre-2005
Ubicación: Almansa
Mensajes: 20
Antigüedad: 19 años, 3 meses
Puntos: 0
Pregunta System.UnauthorizedAccessException

Hola a todos, desde la pagina que estoy haciendo en visual c#.net, en un determinado momento se envia un mail a una direccion de correo que esta fuera del dominio dodne esta la pagina y de donde esta el remitente, y me da el siguiente error:



Server Error in '/' Application.
--------------------------------------------------------------------------------

Acceso denegado.

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: Acceso denegado.


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 <identity impersonate="true"/>, the identity will be the anonymous user (typically IUSR_MACHINENAME) or the authenticated request user.

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.

Source Error:


Line 889: //SmtpMail.SmtpServer="servidor1";
Line 890: //SmtpMail.Send(correo);
Line 891: SmtpMail.Send("[email protected]","[email protected]","prueba4", "probando prueba4");
Line 892: }
Line 893: else


Source File: c:\inetpub\wwwroot\tecnocon\pedido.aspx.cs Line: 891

Stack Trace:


[UnauthorizedAccessException: Acceso denegado.
]

[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 bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams) +2501648
System.Web.Mail.LateBoundAccessHelper.CallMethod(O bject obj, String methodName, Object[] args) +72

[HttpException (0x80004005): Acceso denegado.
]
System.Web.Mail.LateBoundAccessHelper.CallMethod(O bject obj, String methodName, Object[] args) +119
System.Web.Mail.CdoSysHelper.Send(MailMessage message) +2684
System.Web.Mail.CdoSysHelper.Send(String from, String to, String subject, String messageText) +72
System.Web.Mail.SmtpMail.Send(String from, String to, String subject, String messageText) +149
Tecnocon.WebForm1.B_enviar_pedido_Click(Object sender, EventArgs e) in c:\inetpub\wwwroot\tecnocon\pedido.aspx.cs:891
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +105
System.Web.UI.WebControls.Button.RaisePostBackEven t(String eventArgument) +107
System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.RaisePostBackEvent(String eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData) +33
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5102




--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42




si alguien sabe como puedo solucionarlo se lo agradeceria porque estoy un poco desesperado, muchas gracias.