Forum Discussion
msvidya11
14 years agoOccasional Contributor
Hi ,
Thanks David. I tried using the authentication parameter as shown in the example. But still the same error message. Please help me to identify and resolve this issue.
Meanwhile, the same code works fine in Windows XP whereas it throws the specified error only in Windows 7.
<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")
= 2
cdoConfig.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate")
= 1
cdoConfig.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpaccountname")
= smtpAccountName;
cdoConfig.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusername")
= "<username>";
cdoConfig.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword")
= "<password>";
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;
}
}
</Code>
Thanks,
Vidya
Thanks David. I tried using the authentication parameter as shown in the example. But still the same error message. Please help me to identify and resolve this issue.
Meanwhile, the same code works fine in Windows XP whereas it throws the specified error only in Windows 7.
<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")
= 2
cdoConfig.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate")
= 1
cdoConfig.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpaccountname")
= smtpAccountName;
cdoConfig.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusername")
= "<username>";
cdoConfig.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword")
= "<password>";
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;
}
}
</Code>
Thanks,
Vidya