473,699 Members | 2,678 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Setting message priority with CDOSYS

Hello. Can someone please tell me how to set the priority of an email
message
sent from an ASP script using CDOSYS as below -

set oCdoMsg = server.createob ject("CDO.Messa ge")
oCdoMsg.from=.. .
oCdoMsg.to=...
oCdoMsg.subject =...
oCdoMsg.importa nce=1 ' fails
oCdoMsg.HTMLBod y=....
oCdoMsg.send

With CDONTS I successfully used .importance but that fails with CDOSYS.
I have searched the MSDN documentation but can't find it. BTW I find the
various alternatives
confusing - CDO, CDONTS, CDOEX etc.
Thanks in advance for any help.
Peter Croft
Jul 19 '05 #1
6 9047

oCdoMsg.Fields( "urn:schemas:ht tpmail:importan ce").Value = 2;
"Peter Croft" <pe*********@te xtandvideo.co.u k> wrote in message
news:us******** ******@tk2msftn gp13.phx.gbl...
Hello. Can someone please tell me how to set the priority of an email
message
sent from an ASP script using CDOSYS as below -

set oCdoMsg = server.createob ject("CDO.Messa ge")
oCdoMsg.from=.. .
oCdoMsg.to=...
oCdoMsg.subject =...
oCdoMsg.importa nce=1 ' fails
oCdoMsg.HTMLBod y=....
oCdoMsg.send

With CDONTS I successfully used .importance but that fails with CDOSYS.
I have searched the MSDN documentation but can't find it. BTW I find the
various alternatives
confusing - CDO, CDONTS, CDOEX etc.
Thanks in advance for any help.
Peter Croft

Jul 19 '05 #2
That doesn't work. It doesn't raise an error but neither does it change the
priority.
The documentation (if I'm looking in the right place) says Fields is
read-only.

Thanks,
Peter
"dave" <no**@invalid.c om> wrote in message
news:%2******** ********@TK2MSF TNGP12.phx.gbl. ..

oCdoMsg.Fields( "urn:schemas:ht tpmail:importan ce").Value = 2;
"Peter Croft" <pe*********@te xtandvideo.co.u k> wrote in message
news:us******** ******@tk2msftn gp13.phx.gbl...
Hello. Can someone please tell me how to set the priority of an email
message
sent from an ASP script using CDOSYS as below -

set oCdoMsg = server.createob ject("CDO.Messa ge")
oCdoMsg.from=.. .
oCdoMsg.to=...
oCdoMsg.subject =...
oCdoMsg.importa nce=1 ' fails
oCdoMsg.HTMLBod y=....
oCdoMsg.send

With CDONTS I successfully used .importance but that fails with CDOSYS.
I have searched the MSDN documentation but can't find it. BTW I find the
various alternatives
confusing - CDO, CDONTS, CDOEX etc.
Thanks in advance for any help.
Peter Croft


Jul 19 '05 #3
Hi Peter,

I think it should be:

oCdoMsg.Fields( "urn:schemas:ma ilheader:priori ty").Value = 1

Here is related document:

http://msdn.microsoft.com/library/de...us/wss/wss/_cd
o_schema_mailhe ader_priority.a sp?frame=true

http://msdn.microsoft.com/library/de...us/wss/wss/_cd
o_cdopriorityva lues_enum.asp

Luke

Jul 19 '05 #4
I can't get these to work either, even when I set importance to high and
priority to urgent, the header comes in with both stating normal. I think
it might depend on the SMTP server, whether it preserves the values or
ignores them. Here is the code I used (I tried setting the imp/pri on both
config and message):

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

With cdoConfig.Field s
.Item(cdoSendUs ingMethod) = cdoSendUsingPor t
.Item(cdoSMTPSe rver) = "<mail server>"
.Item(cdoPriori ty) = cdoPriorityUrge nt
.Item(cdoImport ance) = cdoHigh
.Update
End With

Set cdoMessage = CreateObject("C DO.Message")

With cdoMessage
Set .Configuration = cdoConfig
.Fields(cdoPrio rity) = cdoPriorityUrge nt
.Fields(cdoImpo rtance) = cdoHigh
.From = "fr**@from. com"
.To = "to@to.com"
.Subject = "Sample CDO Message"
.TextBody = "This is a test for CDO.message"
.Send
End With

Set cdoMessage = Nothing
Set cdoConfig = Nothing
%>

Header still says:

Importance: normal
Priority: normal

--
http://www.aspfaq.com/
(Reverse address to reply.)


"[MSFT]" <lu******@onlin e.microsoft.com > wrote in message
news:PR******** ******@cpmsftng xa06.phx.gbl...
Hi Peter,

I think it should be:

oCdoMsg.Fields( "urn:schemas:ma ilheader:priori ty").Value = 1

Here is related document:

http://msdn.microsoft.com/library/de...us/wss/wss/_cd o_schema_mailhe ader_priority.a sp?frame=true

http://msdn.microsoft.com/library/de...us/wss/wss/_cd o_cdopriorityva lues_enum.asp

Luke

Jul 19 '05 #5
"Aaron [SQL Server MVP]" <te*****@dnartr eb.noraa> wrote in
news:Oj******** ******@TK2MSFTN GP09.phx.gbl:
I can't get these to work either, even when I set importance to high
and priority to urgent, the header comes in with both stating normal.
I think it might depend on the SMTP server, whether it preserves the
values or ignores them. Here is the code I used (I tried setting the
imp/pri on both config and message):

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

With cdoConfig.Field s
.Item(cdoSendUs ingMethod) = cdoSendUsingPor t
.Item(cdoSMTPSe rver) = "<mail server>"
.Item(cdoPriori ty) = cdoPriorityUrge nt
.Item(cdoImport ance) = cdoHigh
.Update
End With

Set cdoMessage = CreateObject("C DO.Message")

With cdoMessage
Set .Configuration = cdoConfig
.Fields(cdoPrio rity) = cdoPriorityUrge nt
.Fields(cdoImpo rtance) = cdoHigh
.From = "fr**@from. com"
.To = "to@to.com"
.Subject = "Sample CDO Message"
.TextBody = "This is a test for CDO.message"
.Send
End With

Set cdoMessage = Nothing
Set cdoConfig = Nothing
%>

Header still says:

Importance: normal
Priority: normal


You code looks fine.....

What software is the smtp server running?

--
Robert Collyer
www.webforumz.com
Free Web Design and Development Help, Discussions, tips and Critique!
ASP, VB, .NET, SQL, CSS, HTML, Javascript, Flash, XML, SEO !
Jul 19 '05 #6
Hi Ten,

I suggested you try Luke's suggestion to set periority.

Another link on this topic:
http://groups.google.com/groups?q=CD...ail&hl=en&lr=&
ie=UTF-8&selm=6gg13vcu ntc5hs35fa8pnc5 taqhnj2ef65%404 ax.com&rnum=1

Peter, is the problem resolved? Thanks.

Best regards,
Yanhong Huang
Microsoft Community Support

Get Secure! ¨C www.microsoft.com/security
Register to Access MSDN Managed Newsgroups!
-http://support.microso ft.com/default.aspx?sc id=/servicedesks/msdn/nospam.as
p&SD=msdn

This posting is provided "AS IS" with no warranties, and confers no rights.

Jul 19 '05 #7

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

Similar topics

1
3373
by: | last post by:
Hi, I am loading some crystal reports in a method similar to this (see below). And set the cursor to waiting while the reoprt is loaded, run and shown. BUT while the report is running the cursor changes back to default. I have tested setting it back to waiting after the call to run the report, - and it does get set. Has anyone else seen this wierd crystal bug I am also putting a message in the status bar - and this hold true the
3
8311
by: Steve Yerkes | last post by:
There seems to be way too much confusion over how to set focus on the a field using a field validator. I looked all over the web and found people trying to do this, but not getting anywhere. There are a couple of people selling components... but that is not really an option for me... So, I took the plunge and modified the "WebUIValidation.js" file to make it happen... After tracing through file, I figure it out. It was actually pretty...
8
2263
by: David Lozzi | last post by:
Howdy, I have a user control that is a report to display data. On the page the control is inserted in, I have filter options to filter the report. When I try to do something like this, nothing happens. dim filt as string ... build filter string... UserControl.ReportFilter = filt
14
1613
by: Bernie Yaeger | last post by:
OK - I'm very close. I'm running a console app on a server and it fails with cdo .message failure. It's a simple email routine which works fine on my development pc. Do you have any idea what would cause this? Thanks for any help. Bernie Yaeger
3
4738
by: DexHex | last post by:
Hi, I am stumpt. Is there anyway to set the background image on a webpart title?
24
6264
by: Manuel | last post by:
Is it possible to embed an image, like a company logo in a CDOSYS generated message? If yes, I´ll apreciate some code sample. I´ve been able to format messages in html the way I like, but I can't figure out how to embed an image. Thanks for your time. -- Manuel
0
1007
by: kvogelgesang | last post by:
Hi all, I have an Access 2000 Database that is programed to send out emails and is working fine except i would like to change the message priority to High so it buzzes people using blackberries when they recieve it. Below is my code to send the emails and i added a line "olMail.Priority = MailPriority.High" to try and set the priority. since i added it i recieve an error stating "SendEmail: Object Required". Can anyone help? Sub...
3
35253
by: John Nagle | last post by:
There's no way to set thread priorities within Python, is there? We have some threads that go compute-bound, and would like to reduce their priority slightly so the other operations, like accessing the database and servicing queries, aren't slowed as much. John Nagle
0
1513
by: afromanam | last post by:
Just in case anyone is interested the code should be <% Set myMail=CreateObject("CDO.Message") myMail.Subject="Sending email with CDO" myMail.From="USERNAME@SERVER.COM" myMail.To="USERNAME@SERVER.COM" myMail.TextBody="This is a message." 'myMail.AddAttachment "c:\mydocuments\test.txt"
0
8704
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
8623
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
9187
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
8894
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7776
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...
0
5879
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4390
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4636
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2360
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.