473,396 Members | 1,760 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

SmtpMail

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.
Nov 19 '05 #1
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.

Nov 19 '05 #2
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.


Nov 19 '05 #3
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.


Nov 19 '05 #4
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.


Nov 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
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
2
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; //...
5
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. ...
2
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...
1
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...
3
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...
4
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...
2
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: ...
3
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...
19
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
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...
0
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
0
BarryA
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...
0
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...
0
marktang
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,...
0
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...
0
jinu1996
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...
0
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...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.