• Debian 11 is approaching its end-of-life (vendor EOL date - August 31, 2026). Plesk Obsidian 18.0.80 will be the last release to support it.
    If you are running Plesk Obsidian on Debian 11, we recommend you upgrade those servers to Debian 12 using our dist-upgrade tool.
  • We plan to deprecate and remove the support for XML RPC protocol versions earlier than 1.6.9.1 in Plesk Obsidian 18.0.82. We strongly recommend that you update all existing integrations using earlier versions of the XML RPC protocol to comply with the version 1.6.9.1 specification.

CDO errors

W

wasim676

Guest
Dear Sir,

Hi,
I am using CDO, it works fine but when I attache some file and send mail then there is following error.

CDO.Message.1 error '80040220'

The "SendUsing" configuration value is invalid.

/American/ozdare/testcdo.asp, line 29



I am using the follwing code,

<!--METADATA TYPE="typelib" UUID="CD000000-8B95-11D1-82DB-00C04FB1625D" NAME="CDO for Windows Library" -->
<!--METADATA TYPE="typelib" UUID="00000205-0000-0010-8000-00AA006D2EA4" NAME="ADODB Type Library" -->


<%
RESPONSE.Buffer=TRUE

'IF Session("user_id")="" AND Request.QueryString(key) then Response.Redirect("sign.asp?SessionExp=true")

%>
<%

Function SendEmail(mailto,mailfrom,mailsubject,message,cc,bcc)


'On Error Resume Next
Dim objCDO
Dim iConf
Dim Flds
'cdoSendUsingPort = 2


Set objCDO = Server.CreateObject("CDO.Message")


Set iConf = Server.CreateObject("CDO.Configuration")


Set Flds = iConf.Fields


With Flds
'.Item(cdoSendUsingMethod) = cdoSendUsingPort
.Item(cdoSendUsingMethod) = 2
.Item(cdoSMTPServer) = "smtp.mydomain.com"
.Item(cdoSMTPServerPort) = 25

.Update
End With


Set objCDO.Configuration = iConf

objCDO.From = mailfrom
objCDO.To = mailto
objCDO.Subject = mailsubject
'objCDO.TextBody = message
objCDO.CC=cc
objCDO.BCC=bcc
objCDO.HTMLBody=message

objCDO.Send


Set ObjCDO = Nothing
Set iConf = Nothing
Set Flds = Nothing
'Response.Write("Error="&err.description)

End Function

Function SendEmailText(mailto,mailfrom,mailsubject,message,cc,bcc)
' Response.Write("3.1")

'On Error Resume Next
Dim objCDO
Dim iConf
Dim Flds
'cdoSendUsingPort = 2

' Response.Write("3.2")
Set objCDO = Server.CreateObject("CDO.Message")


Set iConf = Server.CreateObject("CDO.Configuration")


Set Flds = iConf.Fields
' Response.Write("3.3")

With Flds
'.Item(cdoSendUsingMethod) = cdoSendUsingPort
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
' this is the server SMTP address
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "localhost"
' this is the SMTP PORT
.Item(cdoSMTPServerPort) = 25

.Update
End With


Set objCDO.Configuration = iConf

objCDO.From = mailfrom
objCDO.To = mailto
objCDO.Subject = mailsubject
objCDO.CC=cc
objCDO.BCC=bcc
objCDO.TextBody=message

objCDO.Send

if err.number <> 0 Then
response.Write(err.description)
end if
'Response.Write("Mail Sent")
Set ObjCDO = Nothing
Set iConf = Nothing
Set Flds = Nothing
'Response.Write("Error="&err.description)

End Function


Function SendEmailAtt(mailto,mailfrom,mailsubject,message,cc,bcc,AttFilePath)


'On Error Resume Next
Dim objCDO
Dim iConf
Dim Flds
'cdoSendUsingPort = 2


Set objCDO = Server.CreateObject("CDO.Message")


Set iConf = Server.CreateObject("CDO.Configuration")


Set Flds = iConf.Fields


With Flds
'.Item(cdoSendUsingMethod) = cdoSendUsingPort
.Item(cdoSendUsingMethod) = 2
.Item(cdoSMTPServer) = "mail-fwd"
.Item(cdoSMTPServerPort) = 25

.Update
End With


Set objCDO.Configuration = iConf

objCDO.From = mailfrom
objCDO.To = mailto
objCDO.Subject = mailsubject
'objCDO.TextBody = message
objCDO.CC=cc
objCDO.BCC=bcc
objCDO.HTMLBody=message
if AttFilePath<>"" then
objCDO.AddAttachment(AttFilePath)
end if
objCDO.Send

Set ObjCDO = Nothing
Set iConf = Nothing
Set Flds = Nothing
'Response.Write("Error="&err.description)

End Function
%>
Please! Resolve my issue.
Thanks in advance.

Best Regards,
Wasim.
 
Back
Top