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 = "so*****@abc.com"
Dim MsgTo As String = "so*****@def.com"
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. 4 1440
the user that the site runs under needs access to the smtp folders
--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"MrMike" <Mr****@discussions.microsoft.com> wrote in message
news:41**********************************@microsof t.com... 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 = "so*****@abc.com" Dim MsgTo As String = "so*****@def.com" 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.
Curt_C, What folders exactly are you refering to? Where would these folders
be located? Thanks for your help!
"Curt_C [MVP]" wrote: the user that the site runs under needs access to the smtp folders
-- Curt Christianson Owner/Lead Developer, DF-Software Site: http://www.Darkfalz.com Blog: http://blog.Darkfalz.com
"MrMike" <Mr****@discussions.microsoft.com> wrote in message news:41**********************************@microsof t.com... 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 = "so*****@abc.com" Dim MsgTo As String = "so*****@def.com" 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.
they are on the server in the MailRoot, under the InetPub
--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"MrMike" <Mr****@discussions.microsoft.com> wrote in message
news:0C**********************************@microsof t.com... Curt_C, What folders exactly are you refering to? Where would these folders be located? Thanks for your help!
"Curt_C [MVP]" wrote:
the user that the site runs under needs access to the smtp folders
-- Curt Christianson Owner/Lead Developer, DF-Software Site: http://www.Darkfalz.com Blog: http://blog.Darkfalz.com
"MrMike" <Mr****@discussions.microsoft.com> wrote in message news:41**********************************@microsof t.com... > 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 = "so*****@abc.com" > Dim MsgTo As String = "so*****@def.com" > 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.
Actually I've verified that the permissions were in place, and I've found
that the problem was that I needed to specify
SMTPMail.SMPTServer = "Server IP Address"
Thanks for your help.
"Curt_C [MVP]" wrote: they are on the server in the MailRoot, under the InetPub
-- Curt Christianson Owner/Lead Developer, DF-Software Site: http://www.Darkfalz.com Blog: http://blog.Darkfalz.com
"MrMike" <Mr****@discussions.microsoft.com> wrote in message news:0C**********************************@microsof t.com... Curt_C, What folders exactly are you refering to? Where would these folders be located? Thanks for your help!
"Curt_C [MVP]" wrote:
the user that the site runs under needs access to the smtp folders
-- Curt Christianson Owner/Lead Developer, DF-Software Site: http://www.Darkfalz.com Blog: http://blog.Darkfalz.com
"MrMike" <Mr****@discussions.microsoft.com> wrote in message news:41**********************************@microsof t.com... > 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 = "so*****@abc.com" > Dim MsgTo As String = "so*****@def.com" > 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. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Jason |
last post by:
Hi
just a really quick simple question. Can you configure SmtpMail class in C#
to use a different port? or does it have to be port 25?
Thanks
Jason
|
by: Leszek |
last post by:
Hello,
I have created a simple code to send emails using the MailMessage class and
the SmtpMail.Send() method:
MailMessage mail = new MailMessage();
mail.From = echidna@somewhere.com; //...
|
by: ElanKathir |
last post by:
Hi !
I wrote one code for Send the E-mail, But that code have some problem , So please help me
Here i paste my code and Error:
Error:
Server Error in '/Elan_Sample' Application. ...
|
by: Edward |
last post by:
Hello, everybody,
I tried to send Email out using ASP.NET, but failed, here is the code of sending:
--------------------------------------------------------------------------------
Try...
|
by: Jens Øster |
last post by:
Hi
I am writing a ASP.NET web application that must sent some e-mails.
I get the exception “Could not access 'CDO.Message' object” when I call SmtpMail.Send. This only happens when I send...
|
by: Jens |
last post by:
Hi
I am writing a ASP.NET web application that must sent some e-mails.
I get the exception “Could not access 'CDO.Message' object” when I call SmtpMail.Send. This only happens when I send...
|
by: Aren Cambre |
last post by:
Why does SmtpMail.Send throw an exception if the MailMessage's
BodyFormat = MailFormat.Html? I've searched all over the place and
cannot find a solution anywhere. I am running this on Windows XP...
|
by: kmbarz |
last post by:
I'm trying to expand my horizons here by working through an ASP.Net book.
When I do the example that uses:
Line 55: Mail.From = "feedback@graymad.com"
Line 56: ...
|
by: aslantifosi |
last post by:
hi all,
My question is about that i use a smpt server which is running on a
different machine from my webserver machine. And i can authenticate with a
user and password. I use SmtpMail class. i...
|
by: zdrakec |
last post by:
Hello all:
Using an "Imports System.Web.Mail" clause at the head of my module, and
after executing the following code:
Dim msg As New MailMessage
msg.From = sender
msg.To = recipient...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
| |