Just a little help

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have an asp.net app with C# as the code behind. When a user changes the
'status' (the app has a work-flow feature) of a purchase order I need to
perhaps send an email to a known address.

Thus, if the po is new and the user changes it to 'submitted' then I need to
send an email to the guy in charge of accepting or rejecting purchase orders.
It doesn't have to be from the person that submitted the po, but it has to
indicate the po # (which I have).

Could somebody point me to some documentation where I can figure out how to
write a server side object that allows me to send emails programatically?
 
Rik,

If you are using .NET 1.1 and earlier, you can check out the classes in
the System.Web.Mail namespace. If you are using a beta of 2.0, or will
adopt 2.0 soon, look at the System.Net.Mail namespace.

You can also take a look at the Indy Project
(http://www.indyproject.org/), as they have classes that can send email.

Whatever solution you use, you will have to change the user that the
page runs under. By default, it is ASPNET, and does not have rights to
access the network. You might want to impersonate a user in your page while
you send the email (which can be done through the WindowsIdentity class), or
change the identity that all pages in the app run under (through
web.config). Of course, the latter is easier to config, but much more
dangerous.

Hope this helps.
 
I swear there are so many things to learn. Could you tell me how to change
the identity in web.config? This will be running on an intranet only so the
security is less of an issue.
--
----------------------------------------
Magic is not in the hands of the magician but in the mind of the audience.

Animadverto est verus




Nicholas Paldino said:
Rik,

If you are using .NET 1.1 and earlier, you can check out the classes in
the System.Web.Mail namespace. If you are using a beta of 2.0, or will
adopt 2.0 soon, look at the System.Net.Mail namespace.

You can also take a look at the Indy Project
(http://www.indyproject.org/), as they have classes that can send email.

Whatever solution you use, you will have to change the user that the
page runs under. By default, it is ASPNET, and does not have rights to
access the network. You might want to impersonate a user in your page while
you send the email (which can be done through the WindowsIdentity class), or
change the identity that all pages in the app run under (through
web.config). Of course, the latter is easier to config, but much more
dangerous.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Rik Brooks said:
I have an asp.net app with C# as the code behind. When a user changes the
'status' (the app has a work-flow feature) of a purchase order I need to
perhaps send an email to a known address.

Thus, if the po is new and the user changes it to 'submitted' then I need
to
send an email to the guy in charge of accepting or rejecting purchase
orders.
It doesn't have to be from the person that submitted the po, but it has to
indicate the po # (which I have).

Could somebody point me to some documentation where I can figure out how
to
write a server side object that allows me to send emails programatically?
--
 
Rik,

Here is a link to the identity element in web.config:

http://msdn.microsoft.com/library/d.../en-us/cpgenref/html/gngrfidentitysection.asp


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Rik Brooks said:
I swear there are so many things to learn. Could you tell me how to change
the identity in web.config? This will be running on an intranet only so
the
security is less of an issue.
--
----------------------------------------
Magic is not in the hands of the magician but in the mind of the audience.

Animadverto est verus




Nicholas Paldino said:
Rik,

If you are using .NET 1.1 and earlier, you can check out the classes
in
the System.Web.Mail namespace. If you are using a beta of 2.0, or will
adopt 2.0 soon, look at the System.Net.Mail namespace.

You can also take a look at the Indy Project
(http://www.indyproject.org/), as they have classes that can send email.

Whatever solution you use, you will have to change the user that the
page runs under. By default, it is ASPNET, and does not have rights to
access the network. You might want to impersonate a user in your page
while
you send the email (which can be done through the WindowsIdentity class),
or
change the identity that all pages in the app run under (through
web.config). Of course, the latter is easier to config, but much more
dangerous.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Rik Brooks said:
I have an asp.net app with C# as the code behind. When a user changes
the
'status' (the app has a work-flow feature) of a purchase order I need
to
perhaps send an email to a known address.

Thus, if the po is new and the user changes it to 'submitted' then I
need
to
send an email to the guy in charge of accepting or rejecting purchase
orders.
It doesn't have to be from the person that submitted the po, but it has
to
indicate the po # (which I have).

Could somebody point me to some documentation where I can figure out
how
to
write a server side object that allows me to send emails
programatically?
--
----------------------------------------
Magic is not in the hands of the magician but in the mind of the
audience.

Animadverto est verus
 
Back
Top