How can I configure CDOSYS in IIS 7.5 on Windows 2008? -
like many of @ moment moving legacy classic asp application windows 2003 server windows 2008. have working unable send e-mail through it. because cdosys not configured correctly. despite 4-5 hours' googling , running through api documentation , searching through files on filesystem , system registry unable figure out set.
the asp.net portion of legacy application works fine. able send e-mails localhost without authentication passed through mail server authentication sending destination.
i translated vb6 calls source code powershell script convenience:
$config = new-object -com "cdo.configuration"; $config.load(1); $smtp = new-object -com "cdo.message"; $smtp.configuration = $config; $smtp.from = "me@example.com" $smtp.to = "me@example.com" $smtp.subject = "test" $smtp.textbody = "message"; $smtp.send(); this script sends e-mail correctly on original server. on new server returns error when calling $smtp.send():
exception calling "send" "0" argument(s): "the "sendusing" configuration value invalid.
the configuration between 2 servers quite different. using $config reference above, executed $config.fields | format-list -property name,value on both servers.
old server (where works):
name : http://schemas.microsoft.com/cdo/configuration/languagecode value : en-us name : http://schemas.microsoft.com/cdo/configuration/postusing value : 0 name : http://schemas.microsoft.com/cdo/configuration/sendusing value : 1 name : http://schemas.microsoft.com/cdo/configuration/smtpserverpickupdirectory value : d:\inetpub\mailroot\pickup name : http://schemas.microsoft.com/cdo/configuration/usemessageresponsetext value : true name : urn:schemas:calendar:timezoneid value : 1 new server:
name : http://schemas.microsoft.com/cdo/configuration/languagecode value : en-gb name : http://schemas.microsoft.com/cdo/configuration/postusing value : 0 name : http://schemas.microsoft.com/cdo/configuration/sendusing value : 0 name : http://schemas.microsoft.com/cdo/configuration/usemessageresponsetext value : true name : urn:schemas:calendar:timezoneid value : 0 it seems need make work either configure default send mail localhost, or drop mail in pickup directory. iis smtp server configured @ directory.
however, unable figure out these values set. must set in file or registry somewhere searching through c drive looking phrases "\pickup" , "usemessageresponsetext" , on have not revealed anything. if somewhere guess they're in binary datastore somewhere.
all samples cdosys involve configuring cdo.configuration or cdo.message instance directly throughout code our application loads configuration iis, somehow set @ 1 point someone.
i missed out on classic asp era in unfamiliar territory. said, coworkers active classic asp developers not know how configure this, , original person set has since moved on. it's entirely possible i'm missing simple basic concept here.
i discovered able use sample powershell script when logged in administrator. research lead me post on iis forums has solution issue. unfortunately leads dead links mean doesn't work. had enough hints put solution:
- download , install iis resource kit tools.
- execute
c:\program files (x86)\iis resources\metabase explorer\mbexplorer.exeadministrator. - navigate
/lm/smtpsvc, right-click on , select properties. - enter groups want give access to. in case both users , iis_iusrs read access only.
- navigate
/lm/smtpsvc/1, , set same permissions on node also. - grant read/write access iis_iusrs , users
c:\inetpub\mailroot
so, root cause user trying execute under did not have correct permissions.
regrettably couldn't figure out how script these steps. post makes reference "metaacl.vbs" script couldn't find anywhere; links claim have dead. it's meant installed iis resource kit tools linked above couldn't find anywhere on server.
if find somewhere you'd able perform above steps so:
cscript metaacl.vbs iis://localhost/smtpsvc %computername%\iis_iusrs r cscript metaacl.vbs iis://localhost/smtpsvc/1 %computername%\iis_iusrs r
Comments
Post a Comment