473,404 Members | 2,213 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

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.createobject("CDO.Message")
oCdoMsg.from=...
oCdoMsg.to=...
oCdoMsg.subject=...
oCdoMsg.importance=1 ' fails
oCdoMsg.HTMLBody=....
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 9020

oCdoMsg.Fields("urn:schemas:httpmail:importance"). Value = 2;
"Peter Croft" <pe*********@textandvideo.co.uk> wrote in message
news:us**************@tk2msftngp13.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.createobject("CDO.Message")
oCdoMsg.from=...
oCdoMsg.to=...
oCdoMsg.subject=...
oCdoMsg.importance=1 ' fails
oCdoMsg.HTMLBody=....
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.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...

oCdoMsg.Fields("urn:schemas:httpmail:importance"). Value = 2;
"Peter Croft" <pe*********@textandvideo.co.uk> wrote in message
news:us**************@tk2msftngp13.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.createobject("CDO.Message")
oCdoMsg.from=...
oCdoMsg.to=...
oCdoMsg.subject=...
oCdoMsg.importance=1 ' fails
oCdoMsg.HTMLBody=....
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:mailheader:priority"). Value = 1

Here is related document:

http://msdn.microsoft.com/library/de...us/wss/wss/_cd
o_schema_mailheader_priority.asp?frame=true

http://msdn.microsoft.com/library/de...us/wss/wss/_cd
o_cdopriorityvalues_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("CDO.Configuration")

With cdoConfig.Fields
.Item(cdoSendUsingMethod) = cdoSendUsingPort
.Item(cdoSMTPServer) = "<mail server>"
.Item(cdoPriority) = cdoPriorityUrgent
.Item(cdoImportance) = cdoHigh
.Update
End With

Set cdoMessage = CreateObject("CDO.Message")

With cdoMessage
Set .Configuration = cdoConfig
.Fields(cdoPriority) = cdoPriorityUrgent
.Fields(cdoImportance) = 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******@online.microsoft.com> wrote in message
news:PR**************@cpmsftngxa06.phx.gbl...
Hi Peter,

I think it should be:

oCdoMsg.Fields("urn:schemas:mailheader:priority"). Value = 1

Here is related document:

http://msdn.microsoft.com/library/de...us/wss/wss/_cd o_schema_mailheader_priority.asp?frame=true

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

Luke

Jul 19 '05 #5
"Aaron [SQL Server MVP]" <te*****@dnartreb.noraa> wrote in
news:Oj**************@TK2MSFTNGP09.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("CDO.Configuration")

With cdoConfig.Fields
.Item(cdoSendUsingMethod) = cdoSendUsingPort
.Item(cdoSMTPServer) = "<mail server>"
.Item(cdoPriority) = cdoPriorityUrgent
.Item(cdoImportance) = cdoHigh
.Update
End With

Set cdoMessage = CreateObject("CDO.Message")

With cdoMessage
Set .Configuration = cdoConfig
.Fields(cdoPriority) = cdoPriorityUrgent
.Fields(cdoImportance) = 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=6gg13vcuntc5hs35fa8pnc5taqhnj2ef65%404ax.co m&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.microsoft.com/default.aspx?scid=/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
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...
3
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...
8
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...
14
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...
3
by: DexHex | last post by:
Hi, I am stumpt. Is there anyway to set the background image on a webpart title?
24
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...
0
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...
3
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...
0
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"...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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...
0
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,...
0
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...
0
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,...
0
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...

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.