M
Mark Rae
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
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