Forum Discussion

msvidya11's avatar
msvidya11
Occasional Contributor
13 years ago

CDO Configuration error in Windows 7

Hi,



I am using the CDO configuration to send a test mail to my email account using JScript using Testcomplete. It works perfectly in WinXP, whereas, throws an error in Windows 7. 



Error Message: "The SendUsing Configuration value is invalid".  

PFA the screenshot. Please guide me to resolve this issue





Below is the code I am using to send the test mail:



<Code>



function sendEmail(smtpServerName,smtpAccountName,fromAddress,toAddress,subject) {






  try {


  


  var objMessage = new ActiveXObject("CDO.Message")


  var cdoConfig = new ActiveXObject("CDO.Configuration")






  cdoConfig.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = smtpServerName;


  cdoConfig.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25


  cdoConfig.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 1


  cdoConfig.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1


  cdoConfig.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpaccountname") = smtpAccountName;


  cdoConfig.Fields.Update();  


   


  objMessage.Subject = subject;


  objMessage.From = fromAddress; 


  objMessage.To = toAddress;


  objMessage.TextBody = "This is a test mail."


  objMessage.Fields.Update();


  objMessage.Send();


  


  }


  catch(exception) {   


    throw exception;


  }    


}



function sendTestMail(){

sendEmail("mail.domain.com","mail.domain.com",<From Address>,<To Address>,"Test Mail");



}

</Code>





Thanks in advance,

Vidya

17 Replies