473,785 Members | 3,417 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

cdo.message

Hi Using WIN XP and FP2000

Using CDO.message to out put a message from my site, I get the following
error message 8004020f from using the code:-

strsql = "SELECT * FROM details WHERE patid = " & request("to") & ";"
objrec.open strsql, objconn, adopenforwardon ly, adlockoptimisti c, adcmdtext

thetext = "Hello, " & request("nickto ") & " you have a new message on online
Connect from " & session("userna me") & "<br> <a target='_top'
href='http://www.onlineconne ct.biz/daters'><big><e m><strong>Clic k here to
log
into the site</strong></em></big></a> then check your messages.<br> Good
luck"

Set cdoConfig = Server.CreateOb ject("CDO.Confi guration")
With cdoConfig.Field s
..Item(cdoSendU singMethod) = cdoSendUsingPor t
..Item(cdoSMTPS erver) = "pegasus.intone t.co.uk"
..Update
End With
Set cdoMessage = Server.CreateOb ject("CDO.Messa ge")
With cdoMessage
Set.Configurati on = cdoConfig
..From = "we*******@onli neconnect.biz"
..To = objrec("emailad dress")
..cc = "ul******@hotma il.com"
..Subject = "New messgage from Online Connect"
..HTMLBody = thetext
..Send
End With
Set cdoMessage = Nothing
Set cdoConfig = Nothing

any ideas?? thanks in advance Hugh


Jul 19 '05 #1
3 7013
there is something at aspfaq.com I have posted further down, but first I
would try this code directly below. (its in VB, you need to make
adjustments).

it seems to work from behind firewalls and the like, more info here
http://msdn.microsoft.com/library/de...figuration.asp

Dim iMsg As CDO.Message
Dim iConf
Dim Flds
Const cdoSendUsingPic kup = 1
Const strPickup = "c:\inetpub\mai lroot\pickup"

Private Sub createMailObjec t()
'Create the message object.
Set iMsg = CreateObject("C DO.Message")

'Create the configuration object.
Set iConf = iMsg.Configurat ion

With iConf.Fields
.Item("http://schemas.microso ft.com/cdo/configuration/sendusing") =
cdoSendUsingPic kup

..Item("http://schemas.microso ft.com/cdo/configuration/smtpserverpicku pdirect
ory") = strPickup
.Update
End With

End Sub


Sub sendHTML(cdoTo As String, cdoFRom As String, cdoSubject As String,
cdoHTML As String, Optional cdoAttch As Variant = "")
createMailObjec t
With iMsg
If IsArray(cdoAttc h) Then
For Each thing In cdoAttch
.AddAttachment (thing)
Next
End If
.To = cdoTo
.From = cdoFRom
.Subject = cdoSubject
.HTMLBody = cdoHTML
.Send
End With
Set iMsg = Nothing
End Sub
Sub sendText(cdoTo As String, cdoFRom As String, cdoSubject As String,
cdoText As String, Optional cdoAttch As Variant = "")
createMailObjec t
With iMsg
If IsArray(cdoAttc h) Then
For Each thing In cdoAttch
.AddAttachment (thing)
Next
End If
.To = cdoTo
.From = cdoFRom
.Subject = cdoSubject
.TextBody = cdoText
.Send
End With
Set iMsg = Nothing
End Sub
Sub sendWebPage(cdo To As String, cdoFRom As String, cdoSubject As String,
cdoPage As String, Optional cdoAttch As Variant = "")
createMailObjec t
With iMsg
With iMsg
If IsArray(cdoAttc h) Then
For Each thing In cdoAttch
.AddAttachment (thing)
Next
End If
.To = cdoTo
.From = cdoFRom
.Subject = cdoSubject
.CreateMHTMLBod y cdoPage
.Send
.HTMLBody = ""
End With
End With
Set iMsg = Nothing
End Sub
Private Sub Class_Terminate ()
Set iMsg = Nothing
End Sub




Why does CDO.Message give me an 8004020f error?

492 requests - last updated Thursday, June 27, 2002

When switching from CDONTS to CDO.Message, when using code like the
following (as described in Article #2026):

<%

sch = "http://schemas.microso ft.com/cdo/configuration/"

Set cdoConfig = Server.CreateOb ject("CDO.Confi guration")

cdoConfig.Field s.Item(sch & "sendusing" ) = 2

cdoConfig.Field s.Item(sch & "smtpserver ") = "<enter_mail.se rver_here>"

cdoConfig.field s.update

Set cdoMessage = Server.CreateOb ject("CDO.Messa ge")

Set cdoMessage.Conf iguration = cdoConfig

cdoMessage.From = "fr**@me.co m"

cdoMessage.To = "to@me.com"

cdoMessage.Subj ect = "Sample CDONTS NewMail"

cdoMessage.Text Body = "This is a test for CDONTS message"

cdoMessage.Send

Set cdoMessage = Nothing

Set cdoConfig = Nothing

%>

You might come across the following error:

error '8004020f'

The event class for this subscription is in an invalid partition

/<file>.asp, line <line>

It is not clear where this error message comes from; it's not even in
Microsoft's Knowledge Base or MSDN Library.

However here are some things you can try to alleviate the problem:

1. Make sure the SMTP server allows anonymous (non-authenticated) relaying.
Otherwise, you'll have to use a

mail component that supports SMTP authentication, like ASPEmail.

2. Check if the problem is specific to the domain name(s) used in the e-mail
addresses of the recipients. For

example, some users have complained that they can send to users on their own
domain only; others have

said that they can send to any domain except their own.

3. If you have a proxy or firewall, make sure the web server is set up to
correctly pass through it, that the

SMTP server knows about it, and that the proxy allows access to port 25.

4. Try using a SendUsing value of 1 (pickup) instead of 2 (port). E.g. the
following line:

cdoConfig.Field s.Item(sch & "sendusing" ) = 2

Becomes

cdoConfig.Field s.Item(sch & "sendusing" ) = 1



"Hugh Welford" <hu**********@b tinternet.com> wrote in message
news:ec******** ******@tk2msftn gp13.phx.gbl...
Hi Using WIN XP and FP2000

Using CDO.message to out put a message from my site, I get the following
error message 8004020f from using the code:-

strsql = "SELECT * FROM details WHERE patid = " & request("to") & ";"
objrec.open strsql, objconn, adopenforwardon ly, adlockoptimisti c, adcmdtext
thetext = "Hello, " & request("nickto ") & " you have a new message on online Connect from " & session("userna me") & "<br> <a target='_top'
href='http://www.onlineconne ct.biz/daters'><big><e m><strong>Clic k here to
log
into the site</strong></em></big></a> then check your messages.<br> Good
luck"

Set cdoConfig = Server.CreateOb ject("CDO.Confi guration")
With cdoConfig.Field s
.Item(cdoSendUs ingMethod) = cdoSendUsingPor t
.Item(cdoSMTPSe rver) = "pegasus.intone t.co.uk"
.Update
End With
Set cdoMessage = Server.CreateOb ject("CDO.Messa ge")
With cdoMessage
Set.Configurati on = cdoConfig
.From = "we*******@onli neconnect.biz"
.To = objrec("emailad dress")
.cc = "ul******@hotma il.com"
.Subject = "New messgage from Online Connect"
.HTMLBody = thetext
.Send
End With
Set cdoMessage = Nothing
Set cdoConfig = Nothing

any ideas?? thanks in advance Hugh

Jul 19 '05 #2
http://www.aspfaq.com/2305

--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/
(Reverse e-mail to reply.)

"Hugh Welford" <hu**********@b tinternet.com> wrote in message
news:ec******** ******@tk2msftn gp13.phx.gbl...
Hi Using WIN XP and FP2000

Using CDO.message to out put a message from my site, I get the following
error message 8004020f from using the code:-

strsql = "SELECT * FROM details WHERE patid = " & request("to") & ";"
objrec.open strsql, objconn, adopenforwardon ly, adlockoptimisti c,
adcmdtext

thetext = "Hello, " & request("nickto ") & " you have a new message on
online
Connect from " & session("userna me") & "<br> <a target='_top'
href='http://www.onlineconne ct.biz/daters'><big><e m><strong>Clic k here to
log
into the site</strong></em></big></a> then check your messages.<br> Good
luck"

Set cdoConfig = Server.CreateOb ject("CDO.Confi guration")
With cdoConfig.Field s
.Item(cdoSendUs ingMethod) = cdoSendUsingPor t
.Item(cdoSMTPSe rver) = "pegasus.intone t.co.uk"
.Update
End With
Set cdoMessage = Server.CreateOb ject("CDO.Messa ge")
With cdoMessage
Set.Configurati on = cdoConfig
.From = "we*******@onli neconnect.biz"
.To = objrec("emailad dress")
.cc = "ul******@hotma il.com"
.Subject = "New messgage from Online Connect"
.HTMLBody = thetext
.Send
End With
Set cdoMessage = Nothing
Set cdoConfig = Nothing

any ideas?? thanks in advance Hugh

Jul 19 '05 #3
thanks guys
"Hugh Welford" <hu**********@b tinternet.com> wrote in message
news:ec******** ******@tk2msftn gp13.phx.gbl...
Hi Using WIN XP and FP2000

Using CDO.message to out put a message from my site, I get the following
error message 8004020f from using the code:-

strsql = "SELECT * FROM details WHERE patid = " & request("to") & ";"
objrec.open strsql, objconn, adopenforwardon ly, adlockoptimisti c, adcmdtext
thetext = "Hello, " & request("nickto ") & " you have a new message on online Connect from " & session("userna me") & "<br> <a target='_top'
href='http://www.onlineconne ct.biz/daters'><big><e m><strong>Clic k here to
log
into the site</strong></em></big></a> then check your messages.<br> Good
luck"

Set cdoConfig = Server.CreateOb ject("CDO.Confi guration")
With cdoConfig.Field s
.Item(cdoSendUs ingMethod) = cdoSendUsingPor t
.Item(cdoSMTPSe rver) = "pegasus.intone t.co.uk"
.Update
End With
Set cdoMessage = Server.CreateOb ject("CDO.Messa ge")
With cdoMessage
Set.Configurati on = cdoConfig
.From = "we*******@onli neconnect.biz"
.To = objrec("emailad dress")
.cc = "ul******@hotma il.com"
.Subject = "New messgage from Online Connect"
.HTMLBody = thetext
.Send
End With
Set cdoMessage = Nothing
Set cdoConfig = Nothing

any ideas?? thanks in advance Hugh

Jul 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
16348
by: Brian Keating EI9FXB | last post by:
Would I be correct in saying that the only way to get a user message into a Windows form would be to use P/Invoke with Message? Of is there some part of the .NET API that I am totally un aware of? Thanks for any help Brian
8
10016
by: Rod | last post by:
I have been working with ASP.NET 1.1 for quite a while now. For some reason, opening some ASP.NET applications we wrote is producing the following error message: "The Web server reported the following error when attempting to create or open the Web project located at the following URL: 'http://localhost/WebApplication1'. 'HTTP/1.1 500 Internal Server Error'."
2
3289
by: Microsoft News | last post by:
What I have is a message box that pops up. It is another browser window. The code is a general function that you pass message, title and a key to. The box works great except, that if you are on a page, get the message box, then click ok on the message box go to another page and then back to the first page. The message box pops up again. It is almost like the history or cache still has information about the state and that it knows that...
0
1975
by: ronscottlangham | last post by:
I am working on a custom WCF EndpoingBehavior that will modify the messages coming in and out of my Service. I am having an error related to the modification of the message in the IEndpointBehavior.AfterReceiveRequest(ref Message request,...) method. In the method that creates a new message, I have something similar to ... /// xmlReader defined with new modified content.... /// 'message' is the original message...
2
12175
by: =?Utf-8?B?QWRl?= | last post by:
HI All, I am encountering the following error when I try to send an email through a SMTP server. I believe the problem lies with the authentication part when the network crednetials are used, error is thrown at the .send point. Error is: The following error occured Sending an email: System.ApplicationException: An error occurred sending an email To helen@HerMail.com From ade@MyMail.com Cc Subject A test with Finlistener #1. The body...
3
3838
by: Steven Allport | last post by:
I am working on processing eml email message using the email module (python 2.5), on files exported from an Outlook PST file, to extract the composite parts of the email. In most instances this works fine, the message is read in using message_from_file, is_multipart returns True and I can process each component and extract message attachments. I am however running into problem with email messages that contain emails forwarded as...
0
2701
by: Philluminati | last post by:
I have a Perl SOAP Server which returns this SOAP Message when invoked: <?xml version="1.0" encoding="UTF-8"?><soap:Envelope xmlns:xsi="http:// www.w3.org/2001/XMLSchema-instance" xmlns:soapenc="http:// schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/ XMLSchema" soap:encodingStyle="http://schemas.xmlsoap.org/soap/ encoding/" xmlns:soap="http://schemas.xmlsoap.org/soap/...
2
6500
by: bernd | last post by:
Hi netties, posted this in a different group already, which seems to be inappropriate. I create a message queue with msgget(), sent a 5-byte message to it with msgsnd() and try to receive the queue's content with msgrcv(). Everything seems to work fine, apart from the fact that I get back only the last byte back from the original message (after sending the message ipcs -qA shows clearly that there are 5 Bytes waiting in the
2
2630
by: forums_mp | last post by:
Facing a design problem here and I'm not sure how to solve this. The system consists of bi-directional communication between a subject communicating with two (at least for now ) listeners. Message translation needs to occur during communication. Each message between subject and listener contains 30 words where each word is 16bits in size. The first word in each message is a header. Communication between Subject and Listeners can...
0
9643
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9480
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10315
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10147
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10085
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8968
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7494
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3645
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.