G
Guest
Hi. I have the following code which sends an e-mail from my asp.net
application. This works fine on my localhost, but when I run this from the
server I get an "Access Denied" Message. What do I need to do to run this
successfully from my server? Thanks.
Private Sub btnSend_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnSend.Click
Dim MsgFrom As String = "(e-mail address removed)"
Dim MsgTo As String = "(e-mail address removed)"
Dim MsgBody As String = Me.txtBody.Text & " " &
Request.QueryString("SupportInfo")
SmtpMail.Send(MsgFrom.Trim, MsgTo.Trim, Me.txtSubject.Text.Trim, _
MsgBody.Trim)
End Sub
Error:
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.
application. This works fine on my localhost, but when I run this from the
server I get an "Access Denied" Message. What do I need to do to run this
successfully from my server? Thanks.
Private Sub btnSend_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnSend.Click
Dim MsgFrom As String = "(e-mail address removed)"
Dim MsgTo As String = "(e-mail address removed)"
Dim MsgBody As String = Me.txtBody.Text & " " &
Request.QueryString("SupportInfo")
SmtpMail.Send(MsgFrom.Trim, MsgTo.Trim, Me.txtSubject.Text.Trim, _
MsgBody.Trim)
End Sub
Error:
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.