Hola a todos, desde mi pagina, en un determinado momento quiero que se envie un mail a una direccion de correo que esta fuera del dominio en el que esta la pagina, pero el remitente si que esta en el dominio, y cuando se ejecuta 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("vestuario-gl@tecnocon.biz","RSANCHEZ@UNIHARD.COM","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(Object obj, String methodName, Object[] args) +72
[HttpException (0x80004005): Acceso denegado.
]
System.Web.Mail.LateBoundAccessHelper.CallMethod(Object 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.RaisePostBackEvent(String eventArgument) +107
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection 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.