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