473,800 Members | 2,304 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

smtpauthenticat e & ASPNET_SETREG

Hi,

I'm working on an ASP.NET intranet site which is still in v1.1 of the
Framework. We are using ASPNET_SETREG to impersonate a domain user for
various reasons, as follows:

<identity impersonate="tr ue"
userName="regis try:HKLM\SOFTWA RE\Intranet\ide ntity\ASPNET_SE TREG,userName"
password="regis try:HKLM\SOFTWA RE\Intranet\ide ntity\ASPNET_SE TREG,password"
/>

Works perfectly.

However, we now have a requirement to get the site to send external email.
When I first tried this, I got the "Unable to relay..." CDO message. Looking
this up on www.systemwebmail led me to add the following to the SendMail
code:

objMsg.Fields.A dd("http://schemas.microso ft.com/cdo/configuration/smtpauthenticat e",
"1");
objMsg.Fields.A dd("http://schemas.microso ft.com/cdo/configuration/sendusername",
"<userid>") ;
objMsg.Fields.A dd("http://schemas.microso ft.com/cdo/configuration/sendpassword",
"<password> ");
SmtpMail.SmtpSe rver = "<mailserve r>";
SmtpMail.Send(o bjMsg);

That now allows the site to send external mail, which is fine so long as I
hard-code the username and password into the above code.

Is there anyway that I can combine the two i.e. get the CDO fields from the
registry in the same way as ASP.NET does when implementing the
impersonation?

Any assistance gratefully received.

Best,

Mark
Nov 29 '05 #1
1 1894
No-one got any ideas...?

"Mark Rae" <ma**@mark-N-O-S-P-A-M-rae.co.uk> wrote in message
news:%2******** ********@TK2MSF TNGP15.phx.gbl. ..
Hi,

I'm working on an ASP.NET intranet site which is still in v1.1 of the
Framework. We are using ASPNET_SETREG to impersonate a domain user for
various reasons, as follows:

<identity impersonate="tr ue"

userName="regis try:HKLM\SOFTWA RE\Intranet\ide ntity\ASPNET_SE TREG,userName"

password="regis try:HKLM\SOFTWA RE\Intranet\ide ntity\ASPNET_SE TREG,password"
/>

Works perfectly.

However, we now have a requirement to get the site to send external email.
When I first tried this, I got the "Unable to relay..." CDO message.
Looking this up on www.systemwebmail led me to add the following to the
SendMail code:
objMsg.Fields.A dd("http://schemas.microso ft.com/cdo/configuration/smtpauthenticat e",
"1");

objMsg.Fields.A dd("http://schemas.microso ft.com/cdo/configuration/sendusername",
"<userid>") ;

objMsg.Fields.A dd("http://schemas.microso ft.com/cdo/configuration/sendpassword",
"<password> ");
SmtpMail.SmtpSe rver = "<mailserve r>";
SmtpMail.Send(o bjMsg);

That now allows the site to send external mail, which is fine so long as I
hard-code the username and password into the above code.

Is there anyway that I can combine the two i.e. get the CDO fields from
the registry in the same way as ASP.NET does when implementing the
impersonation?

Any assistance gratefully received.

Best,

Mark

Dec 4 '05 #2

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

Similar topics

1
5028
by: Duncan Allen | last post by:
I'm trying to use aspnet_setreg to encrypt user names & password used in the web.config file for use in the indentity element. When the website runs I get the message 'Error reading the password from the registry'. I'm using Windows XP SP2, Framework 1.1 . The code in the web.config file is : <identity impersonate="true" password="registry:HKLM\SOFTWARE\MyCompany\MyApp\Website\Identity\ASPNET_SETREG,password...
0
1412
by: RichW | last post by:
We are having some problems with invalid characters in passwords when using aspnet_setreg. Aspnet_setreg seems to generate the registry keys successfully, but then the asp.net application using the username/password encrypted with aspnet_setreg won't start properly because of a problem with the password. For information, we have a utility that generates strong passwords for us. The passwords could contain most of the special...
3
3191
by: Peter Rilling | last post by:
Can aspnet_setreg.exe work for regular app.config files as well?
1
1313
by: Andy | last post by:
Hi all, I am trying to use aspnet_setreg to encrypt a user name and password to be used in the sessionstate section of my web.config file. I have the various knowledge base articles from Microsoft on the subject (329290 and 821616) This is in a Windows 2003 Server environment, with .Net 1.1
1
1651
by: Kevin Burton | last post by:
As was suggested I am using aspnet_setreg but I am getting the following error: : Error reading the password from the registry. (c:\inet pub\wwwroot\IVRService\web.config line 46) at System.Web.HttpRuntime.FirstRequestInit(HttpContext context) at System.Web.HttpRuntime.ProcessRequestInternal (HttpWorkerRequest wr)
1
2099
by: Kevin Burton | last post by:
I am using aspnet_setreg but the permissions that it sets the registry to leave the application unable to access the information. I want to add the ASPNET account on the machine that our application is being installed on with read privilege automatically. Does anyone know of a way to easily set registry permissions? I would prefer to use .NET (C#) but I can always wrap any code that does this. I am suspecting that this will involve C++ or...
0
951
by: microsoft.public.dotnet.framework.aspnet.webcontro | last post by:
I have a webservice up and running locally on my dev machine (XP) using impersonate like so: Line 5: <identity impersonate="true" Line 6: userName="registry:HKLM\SOFTWARE\Security\identity\ASPNET_SETREG,userName" Line 7: password="registry:HKLM\SOFTWARE\Security\identity\ASPNET_SETREG,password"/> The webservice comes up fine on there, but when I moved it to a server
2
1956
by: jay | last post by:
I am attempting to impersonate an account in ASPNET. I am using aspnet_setreg to store the username and passwords. I have given the ASPNET account permisision to read the registry values. However, the application throws: "Could not create Windows user token from the credentials specified in the config file. Error from the operating system 'A required privilege is not held by the client'." This occurs even when the ASPNET account has...
0
4482
by: tcochunk | last post by:
I have a VS .Net 2003 solution that contains 2 projects. Project 1 is an ASP .Net application. Project 2 is an EXE that is executed from another program (no UI). Both projects interact with a SmarTeam database. I used aspnet_setreg.exe to encrypt the username and password for the asp process. I would like to retrieve these values from the registry
0
9551
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10505
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10275
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10253
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10033
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7576
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5471
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4149
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2945
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.