PDA

View Full Version : sending email automatically with ASP using CDO - getting (0x8004020F)


crmpicco
08-19-2006, 04:32 PM
I seem to be getting nowhere fast with this problem. I am attempting to send email automatically with my ASP script (named sendEmailCDO.sys).

I am recieving this error:

Error Type:
(0x8004020F)
The event class for this subscription is in an invalid partition
/picco/sendEmailCDO.asp, line 24

==============================================

I am trying to send it from my server (at crmpicco.co.uk). craig@crmpicco.co.uk is a valid address on that domain.

Line 24 is the Send line.


<!--
METADATA
TYPE="typelib"
UUID="CD000000-8B95-11D1-82DB-00C04FB1625D"
NAME="CDO for Windows 2000 Library"
-->
<%
Set cdoConfig = CreateObject("CDO.Configuration")

With cdoConfig.Fields
.Item(cdoSendUsingMethod) = cdoSendUsingPort
.Item(cdoSMTPServer) = "mail.crmpicco.co.uk"
.Update
End With

Set cdoMessage = CreateObject("CDO.Message")

With cdoMessage
Set .Configuration = cdoConfig
.From = "craig@crmpicco.co.uk"
.To = "crmpicco@hotmail.com"
.Subject = "Sample CDO Message"
.TextBody = "This is a test for CDO.message"
.Send
End With

Set cdoMessage = Nothing
Set cdoConfig = Nothing
%>


Any help appreciated.

Picco

crmpicco
08-19-2006, 04:38 PM
Something I thought is worth mentioning when I change the To. address to mail@crmpicco.co.uk (another address at crmpicco.co.uk) it works fine. Is it only allowing me to send to other mailboxes on my domain?

My domain/package is with themooseisloose FYI.

Picco

corics15
08-22-2006, 05:49 AM
try this, hope it helps! :D

Dim ClientIP

if Request.ServerVariables("HTTP_X_FORWARDED_FOR") <> "" then
ClientIP = Request.ServerVariables("HTTP_X_FORWARDED_FOR")
else
ClientIP = Request.ServerVariables("REMOTE_ADDR")
end if

Dim objCDOSYSMail
Set objCDOSYSMail = Server.CreateObject("CDO.Message")
Dim objCDOSYSCnfg
Set objCDOSYSCnfg = Server.CreateObject("CDO.Configuration")

objCDOSYSCnfg.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "mail.crmpicco.co.uk"

with objCDOSYSMail
.Configuration = objCDOSYSCnfg
.From = "craig@crmpicco.co.uk"
.Subject = "Sample CDO Message"
.TextBody = "This is a test for CDO.message"
.To = " <crmpicco@hotmail.com>"
.Send
end with

crmpicco
08-29-2006, 04:59 PM
Hi corics,
this is the error message I am getting?
Why is it only allowing me to send the mailboxes on the same domain??
Is this normal??


Error Type:
CDO.Message.1 (0x80040220)
The "SendUsing" configuration value is invalid.
/picco/email_corics.asp, line 23

corics15
08-31-2006, 10:29 AM
Hi corics,
this is the error message I am getting?
Why is it only allowing me to send the mailboxes on the same domain??
Is this normal??


Error Type:
CDO.Message.1 (0x80040220)
The "SendUsing" configuration value is invalid.
/picco/email_corics.asp, line 23


I have tested the code I gave you using your mail domain and went straight to my inbox. Could you send the whole code so we could check it out?