473,408 Members | 1,762 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,408 software developers and data experts.

smtpauthenticate & 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="true"
userName="registry:HKLM\SOFTWARE\Intranet\identity \ASPNET_SETREG,userName"
password="registry:HKLM\SOFTWARE\Intranet\identity \ASPNET_SETREG,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.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate",
"1");
objMsg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername",
"<userid>");
objMsg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword",
"<password>");
SmtpMail.SmtpServer = "<mailserver>";
SmtpMail.Send(objMsg);

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 1869
No-one got any ideas...?

"Mark Rae" <ma**@mark-N-O-S-P-A-M-rae.co.uk> wrote in message
news:%2****************@TK2MSFTNGP15.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="true"

userName="registry:HKLM\SOFTWARE\Intranet\identity \ASPNET_SETREG,userName"

password="registry:HKLM\SOFTWARE\Intranet\identity \ASPNET_SETREG,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.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate",
"1");

objMsg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername",
"<userid>");

objMsg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword",
"<password>");
SmtpMail.SmtpServer = "<mailserver>";
SmtpMail.Send(objMsg);

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
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...
0
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...
3
by: Peter Rilling | last post by:
Can aspnet_setreg.exe work for regular app.config files as well?
1
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...
1
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...
1
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...
0
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:...
2
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,...
0
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...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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,...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.