• Halloween is coming! To celebrate the occasion, we dusted off a couple of old skins, and even created a brand new one (Pixel).
    To get into the festive spirit, install the Skins extension.
  • The new Python extension is now available. It allows customers to deploy and manage WSGI-based Python applications on their websites directly from Plesk.
  • The Plesk Mobile apps for iOS and Android and the Plesk Mobile Center extension have been deprecated, and are no longer available for new installations. In Plesk Obsidian 18.0.84, the Plesk Mobile Center extension will be removed from servers during the upgrade, and the Plesk Mobile apps will lose their server management features.
  • The Social Login extension has been deprecated and will be removed in Plesk Obsidian 18.0.84. After that, it will no longer be possible to log in to Plesk with a Google, Facebook, GitHub account, or with a passkey. Plesk usernames and passwords, as well as logging in with a WebPros Account, are not affected.

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